Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutations should not ever use GET #357

Closed
adrian-skybaker opened this issue Jun 2, 2022 · 1 comment · Fixed by #663
Closed

Mutations should not ever use GET #357

adrian-skybaker opened this issue Jun 2, 2022 · 1 comment · Fixed by #663
Labels

Comments

@adrian-skybaker
Copy link

If the fetcher is configured to use GET, the result is that even mutations are issued as GETs.

From the closest thing to a spec in this area (https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md):

GET requests MUST NOT be used for executing mutation operations.

See https://github.com/apollographql/apollo-client/blob/287aa465d56fea7d2171533921e73b78caac26a7/src/link/http/createHttpLink.ts#L99-L104 for behaviour that ignores a request for a GET containing a mutation.

If preserving the current behaviour is desireable for backwards compatibility, perhaps a separate "preferGet" type flag could be used, which uses POST for mutation and GET for all else.

@jasonkuhrt
Copy link
Member

Thanks @adrian-skybaker I agree let's change this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants