nuxt-graphql-server
nuxt-graphql-server copied to clipboard
Using Subscription
Hello, I tried to used graphql-ws with apollo server follow https://www.apollographql.com/docs/apollo-server/data/subscriptions but I could not get it working. I have try to pass both express and h3 server to createServer but still get the error: not support grahql-ws can you help me ?
Websockets are currently not yet supported by h3/nuxt. There are a few workarounds (relatively easy for dev server, pretty hacky for production). I've raised https://github.com/unjs/nitro/issues/678 to discuss proper ws support with nuxt.
Maybe relevant: https://github.com/nuxt/nuxt/pull/19230
Is it still blocked or resolved? h3 supports ws tho
@wokalek Thanks for the pointer. Indeed, h3 now supports ws via crossws and it was pretty straightforward to implement graphql-ws support on top it. For me, it's working great so far, and I will include it in the apollo-server h3-integration package: https://github.com/apollo-server-integrations/apollo-server-integration-h3/pull/65. Would be awesome if you could give it a try and report back if you encounter any errors.