Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fullWsTransport and mutations result in MER_ERR_METHOD_NOT_ALLOWED? #977

Unanswered
tomi-bigpi asked this question in Q&A
Discussion options

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"

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Good spot! Would you like to send a PR to fix?

You must be logged in to vote
1 reply
Comment options

PR here: #986

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /