Skip to content

[6.x] GraphQL API Authentication#14292

Open
duncanmcclean wants to merge 3 commits into6.xfrom
graphql-auth
Open

[6.x] GraphQL API Authentication#14292
duncanmcclean wants to merge 3 commits into6.xfrom
graphql-auth

Conversation

@duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Mar 18, 2026

This pull request adds authentication to the GraphQL API.

To enable, add the STATAMIC_GRAPHQL_AUTH_TOKEN key to your .env:

STATAMIC_GRAPHQL_AUTH_TOKEN=some-random-string

Then, when making requests to the GraphQL API, include the API token as a header:

curl -X GET "https://example.com/graphql" \
  -H "Authorization: Bearer some-random-string" \
  -H "Accept: application/json"
  -d '{"query": "{ping}"}'

If you need full-on user authentication, we recommend using something like Laravel Sanctum instead.

We added authentication to the REST API in #12051, and ever since then I've been meaning to add it to GraphQL too for feature parity, so here we are!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant