Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Feature Request: override HTTP method for specific queries #1251

Open
ghost opened this issue Feb 26, 2020 · 0 comments
Open

Feature Request: override HTTP method for specific queries #1251

ghost opened this issue Feb 26, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Feb 26, 2020

I don't want to open yet another discussion regarding HTTP GET vs POST for GraphQL queries, but I wonder if there is way today to customise the HTTP method per-query?

I wish to set the useGETForQueries flag to true by default in order to take advantage of HTTP caching.
However, I run the API on AWS API Gateway which introduces hard HTTP limitations, especially on the queryString:

  • max 8192 characters for edge-optimised APIs
  • max 10240 characters for regional APIs

In my current project, it happens that some queries reach those limitations, and API Gateway started to returns 413 Payload Too Large errors

I would find it useful to have an option to override the HTTP method for specific queries, for instance in the query options?

const { error, loading, data } = useQuery(SOME_TOO_LONG_QUERY_FOR_GET, {
  httpMethod: 'POST'
});

Not sure if that makes sense or if other ways could be better?

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

No branches or pull requests

0 participants