Closed sadhakbj closed 5 years ago
You configured a Laravel Middleware for it and tell graph-playground to use it via https://github.com/mll-lab/laravel-graphql-playground/blob/dd014d8edfe7b845a22e1612b935f6055e99c960/config/graphql-playground.php#L9-L12
This is not the solution that I need, this config will basically prevent me from viewing the playground.
I am using Laravel passport for JWT authentication. Inside my schema.graphql i have the following query:
categories: [Category] @all @middleware(checks: ["auth:api"])
I want to get access to this query in the same that we used to do for the restful APIS by passing the JWT token (probably from the playground for testing) .
The query in my playground to get the categories looks like:
query {
categories {
name
}
}
When I press the run button I get the following error:
"errors": [
{
"debugMessage": "Route [login] not defined.",
"message": "Internal server error",
"category": "internal",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"categories"
],
I want to implement the authentication using Laravel Lighthouse and playground.
Does that answer your question?
@spawnia I will give it a try.
I have created one issue on the lighthouse repository. I am getting error trying to implement the auth:api middleware: https://github.com/nuwave/lighthouse/issues/579
Alright. It seems that this issue does not really concern this repo though, since it seems to be a more general problem with authentication. This is really only a thin integration layer for GraphQL Playground.
@sadhakbj maybe that answer your question !!
@josevalero yes the issue was solved long back
For the protected / guarded routes I need to pass the JWT token , how can I do this with Larvel graphql playground ?