-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add graphql to api token documentation #1287
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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, Shaun.
How would one pass the API token along with the GraphQL query or mutation? I don't think it's documented somewhere, could you please check (maybe with @Convly) how it works?
It works with an authorization header, I believe in exactly the same way as the REST API, but I think it's worth repeating in the graphql documentation. It might also be helpful to add a note for how to do that with the Graphql Playground. Here's an explanation: https://docs.wellline.com/wellline-recipes/timeline-service-graphql-api/using-the-graphql-playground-1 |
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.
LGTM
|
|
||
| Then on each request, send along an `Authorization` header in the form of `{ "Authorization": "Bearer YOUR_JWT_GOES_HERE" }`. This can be set in the HTTP Headers section of your GraphQL Playground. | ||
|
|
||
| ### API tokens |
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.
Should this be at the ## level so that it doesn't fall under the "Users and Permissions Plugin" section, since API tokens are an alternate option to the plugin?
Although, I wonder if this could be combined or simplified somehow (maybe outside the scope of what you're doing, but a future note). That is, the authorization header works exactly the same whether it's a JWT or API Token. So we could have a section about "Adding an authorization header" that explains the bearer token is either an API Token, or the JWT returned from a login.
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.
You are correct, I fixed the header level.
On the second point, I agree and it is something we can revisit in the next quarter. We have been discussing a concepts section with @Aurelsicoko and one of the topics that I think we should cover early on is authentication/authorization.
ben's comments Co-authored-by: Ben Irvin <ben@innerdvations.com>
|
This pull request has been mentioned on Strapi Community Forum. There might be relevant details there: https://forum.strapi.io/t/new-documentation-release-v4-5-5/24573/1 |
What does it do?
Add GraphQL API and link in the API token documentation to match the user guide documentation.
Why is it needed?
responding to a Discord user question.
Related issue(s)/PR(s)
Let us know if this is related to any issue/pull request