mercurius-js / mercurius

Implement GraphQL servers and gateways with Fastify
https://mercurius.dev/
MIT License
2.34k stars 234 forks source link

Error: websocket handler can only be declared in GET method when exposeHeadRoutes is used #457

Open HosseinAgha opened 3 years ago

HosseinAgha commented 3 years ago

When exposeHeadRoutes is true in fastify factory function options, I get the Error: websocket handler can only be declared in GET method. I think this error is from Mercurius as I don't use WebSocket plugin.
As this option is enabled by default in fastify (https://github.com/fastify/fastify/pull/2826), I think we need to resolve this issue as fast as possible.

mcollina commented 3 years ago

This option is not enabled by default. It will be enabled in the next major release.

mcollina commented 3 years ago

Would you like to send a Pull Request to address this issue? Remember to add unit tests.

HosseinAgha commented 3 years ago

Thank you, I'd be happy to. But I'm so busy at the moment. I'll try to open a PR as soon as I could.