WPGraphQL
Simple-JWT-Login integrates with WPGraphQL to bring JWT authentication to your GraphQL layer. Once configured, any GraphQL query or mutation can require a valid JWT, making it straightforward to build secure, headless WordPress applications.
Why use this integration?
- Authenticate GraphQL requests with the same JWT tokens used for REST API calls
- Protect sensitive queries and mutations so only logged-in users can execute them
- Works with any front-end framework (React, Vue, Next.js, etc.) or mobile client that supports HTTP headers
Setup Guide
Enable WPGraphQL Authentication
Go to Simple-JWT-Login Settings and enable WPGraphQL Authorization.
Test an Unauthenticated Request
Try calling a WPGraphQL endpoint without authentication—you should receive an Unauthorized error:
Authenticate and Use JWT
Once you authenticate and obtain a valid JWT, include it in your request headers.
Now, your API calls will be authenticated:
