-
Notifications
You must be signed in to change notification settings - Fork 249
fullWsTransport
and mutations result in MER_ERR_METHOD_NOT_ALLOWED
?
#977
-
Based on the documentation for fullWsTransport
it seems like you should be able to perform mutations over web sockets, but in practice this results in a "Method not allowed" error.
This is happening because of the check here: https://github.com/mercurius-js/mercurius/blob/master/index.js#L474
It checks whether the raw request is GET
and doesn't allow mutations. But the raw request in the case of web sockets is the original GET request that receives a 101 Switching protocols / connection upgrade.
Is this intended behavior?
As a side note, this actually results in an invalid response that at least Apollo client doesn't like and errors with ApolloError: "error" message expects the 'payload' property to be an array of GraphQL errors, but got "Method not allowed"
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
Good spot! Would you like to send a PR to fix?
Beta Was this translation helpful? Give feedback.
All reactions
-
PR here: #986
Beta Was this translation helpful? Give feedback.