-
Notifications
You must be signed in to change notification settings - Fork 0
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
docs: add explanation about GET Vs POST queries #99
base: main
Are you sure you want to change the base?
Conversation
@theodesp LGTM 🚀 Should we include anything about caching too. Would there be a reason why someone might use GET over POST (or visa versa) in relation to caching? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @theodesp for adding info about caching.
LGTM 🚀 🚀 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work. Let's add a brief section on [Automatic] Persisted Queries and how APQs solve the issues with GET requests with links out to Apollo docs or the GraphQL spec (if there is one) where folks can get more info. a link to the how-to could be good too.
|
||
Each property is provided as an HTTP query parameter, with values separated by an ampersand (&). | ||
|
||
GraphQL requests with variables don't work in GET requests because they need to be parsed as JSON. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not true:
https://graphql-cache.local/graphql?query=query($slug:ID!){post(id:$slug,idType:SLUG,asPreview:false){title,content}}&variables={%22slug%22:%22hello-world%22}
| Method | Security | Complexity | Support | Use Case | | ||
|--------------------------|------------------------------------------|-----------------|------------|------------------------| | ||
| POST | More secure, hides query in request body | Complex queries | Production | complex data retrieval | | ||
| GET with Query Parameter | Less secure due to query exposure in URL | Simple queries (no mutations) | Testing | simple data retrieval | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTTPS secures URL information only domain is exposed due to DNS and TLS being established. see: https://stackoverflow.com/a/499594
Co-authored-by: Alex Moon <moonmeister@users.noreply.github.com>
Co-authored-by: Alex Moon <moonmeister@users.noreply.github.com>
#53