fullWsTransport
and mutations result in MER_ERR_METHOD_NOT_ALLOWED
?
#977
Unanswered
tomi-bigpi
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Good spot! Would you like to send a PR to fix? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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