DEV Community

loading...

Discussion on: GraphQL Auth with Passport and Lighthouse PHP

Collapse
ljlizarraga profile image
Luis Lizarraga

Buenas Jose Luis he segudo tu excelente turorial pero no se por que me sucede esto tengo la version 5.8 de laravel

por insomnia me he autenticado con passport ya sin problemas he realizado peticiones pero al momento de hacerlo con el playground tal como indicas revienta, si puedes ayudarme te lo agradezco Gracias

----CONSULTA----
mutation {
login(input: {
username: "lj.lizarraga@gmail.com",
password: "123456"
}) {
access_token
}
}

------ERROR

{
"errors": [
{
"message": "Client authentication failed",
"extensions": {
"guards": [],
"category": "authentication"
},
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"login"
],
"trace": [
{
"file": "/home/unknown/Escritorio/eqpon/vendor/joselfonseca/lighthouse-graphql-passport-auth/src/GraphQL/Mutations/Login.php",
"line": 21,
"call": "Joselfonseca\LighthouseGraphQLPassport\GraphQL\Mutations\BaseAuthResolver::makeRequest(array(5))"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/nuwave/lighthouse/src/Schema/Directives/FieldDirective.php",
"line": 71,
"call": "Joselfonseca\LighthouseGraphQLPassport\GraphQL\Mutations\Login::resolve(null, array(3), instance of Nuwave\Lighthouse\Schema\Context, instance of GraphQL\Type\Definition\ResolveInfo)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/nuwave/lighthouse/src/Execution/Arguments/SpreadMiddleware.php",
"line": 42,
"call": "Nuwave\Lighthouse\Schema\Directives\FieldDirective::Nuwave\Lighthouse\Schema\Directives\{closure}(null, array(2), instance of Nuwave\Lighthouse\Schema\Context, instance of GraphQL\Type\Definition\ResolveInfo)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/nuwave/lighthouse/src/Schema/Factories/FieldFactory.php",
"line": 194,
"call": "Nuwave\Lighthouse\Execution\Arguments\SpreadMiddleware::Nuwave\Lighthouse\Execution\Arguments\{closure}(null, array(1), instance of Nuwave\Lighthouse\Schema\Context, instance of GraphQL\Type\Definition\ResolveInfo)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 632,
"call": "Nuwave\Lighthouse\Schema\Factories\FieldFactory::Nuwave\Lighthouse\Schema\Factories\{closure}(null, array(1), instance of Nuwave\Lighthouse\Schema\Context, instance of GraphQL\Type\Definition\ResolveInfo)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 560,
"call": "GraphQL\Executor\ReferenceExecutor::resolveOrError(instance of GraphQL\Type\Definition\FieldDefinition, instance of GraphQL\Language\AST\FieldNode, instance of Closure, null, instance of Nuwave\Lighthouse\Schema\Context, instance of GraphQL\Type\Definition\ResolveInfo)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 478,
"call": "GraphQL\Executor\ReferenceExecutor::resolveField(GraphQLType: Mutation, null, instance of ArrayObject(1), array(1))"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 921,
"call": "GraphQL\Executor\ReferenceExecutor::GraphQL\Executor\{closure}(array(0), 'login')"
},
{
"call": "GraphQL\Executor\ReferenceExecutor::GraphQL\Executor\{closure}(array(0), 'login')"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 923,
"function": "array_reduce(array(1), instance of Closure, array(0))"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 494,
"call": "GraphQL\Executor\ReferenceExecutor::promiseReduce(array(1), instance of Closure, array(0))"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 256,
"call": "GraphQL\Executor\ReferenceExecutor::executeFieldsSerially(GraphQLType: Mutation, null, array(0), instance of ArrayObject(1))"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php",
"line": 208,
"call": "GraphQL\Executor\ReferenceExecutor::executeOperation(instance of GraphQL\Language\AST\OperationDefinitionNode, null)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/webonyx/graphql-php/src/Executor/Executor.php",
"line": 155,
"call": "GraphQL\Executor\ReferenceExecutor::doExecute()"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/webonyx/graphql-php/src/GraphQL.php",
"line": 165,
"call": "GraphQL\Executor\Executor::promiseToExecute(instance of GraphQL\Executor\Promise\Adapter\SyncPromiseAdapter, instance of GraphQL\Type\Schema, instance of GraphQL\Language\AST\DocumentNode, null, instance of Nuwave\Lighthouse\Schema\Context, array(0), null, null)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/webonyx/graphql-php/src/GraphQL.php",
"line": 98,
"call": "GraphQL\GraphQL::promiseToExecute(instance of GraphQL\Executor\Promise\Adapter\SyncPromiseAdapter, instance of GraphQL\Type\Schema, 'mutation {\n login(input: {username: \"lj.lizarraga@gmail.com\", password: \"123456\"}) {\n access_token\n }\n}', null, instance of Nuwave\Lighthouse\Schema\Context, array(0), null, null, array(29))"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/nuwave/lighthouse/src/GraphQL.php",
"line": 170,
"call": "GraphQL\GraphQL::executeQuery(instance of GraphQL\Type\Schema, 'mutation {\n login(input: {username: \"lj.lizarraga@gmail.com\", password: \"123456\"}) {\n access_token\n }\n}', null, instance of Nuwave\Lighthouse\Schema\Context, array(0), null, null, array(29))"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/nuwave/lighthouse/src/GraphQL.php",
"line": 109,
"call": "Nuwave\Lighthouse\GraphQL::executeQuery('mutation {\n login(input: {username: \"lj.lizarraga@gmail.com\", password: \"123456\"}) {\n access_token\n }\n}', instance of Nuwave\Lighthouse\Schema\Context, array(0), null, null)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/nuwave/lighthouse/src/Support/Http/Controllers/GraphQLController.php",
"line": 70,
"call": "Nuwave\Lighthouse\GraphQL::executeRequest(instance of Nuwave\Lighthouse\Execution\LighthouseRequest)"
},
{
"call": "Nuwave\Lighthouse\Support\Http\Controllers\GraphQLController::query(instance of Nuwave\Lighthouse\Execution\LighthouseRequest)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
"line": 54,
"function": "call_user_func_array(array(2), array(1))"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
"line": 45,
"call": "Illuminate\Routing\Controller::callAction('query', array(1))"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
"line": 219,
"call": "Illuminate\Routing\ControllerDispatcher::dispatch(instance of Illuminate\Routing\Route, instance of Nuwave\Lighthouse\Support\Http\Controllers\GraphQLController, 'query')"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
"line": 176,
"call": "Illuminate\Routing\Route::runController()"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 680,
"call": "Illuminate\Routing\Route::run()"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 130,
"call": "Illuminate\Routing\Router::Illuminate\Routing\{closure}(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/nuwave/lighthouse/src/Support/Http/Middleware/AcceptJson.php",
"line": 30,
"call": "Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 171,
"call": "Nuwave\Lighthouse\Support\Http\Middleware\AcceptJson::handle(instance of Illuminate\Http\Request, instance of Closure)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 105,
"call": "Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 682,
"call": "Illuminate\Pipeline\Pipeline::then(instance of Closure)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 657,
"call": "Illuminate\Routing\Router::runRouteWithinStack(instance of Illuminate\Routing\Route, instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 623,
"call": "Illuminate\Routing\Router::runRoute(instance of Illuminate\Http\Request, instance of Illuminate\Routing\Route)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 612,
"call": "Illuminate\Routing\Router::dispatchToRoute(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 176,
"call": "Illuminate\Routing\Router::dispatch(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 130,
"call": "Illuminate\Foundation\Http\Kernel::Illuminate\Foundation\Http\{closure}(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"call": "Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 171,
"call": "Illuminate\Foundation\Http\Middleware\TransformsRequest::handle(instance of Illuminate\Http\Request, instance of Closure)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"call": "Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 171,
"call": "Illuminate\Foundation\Http\Middleware\TransformsRequest::handle(instance of Illuminate\Http\Request, instance of Closure)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
"line": 27,
"call": "Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 171,
"call": "Illuminate\Foundation\Http\Middleware\ValidatePostSize::handle(instance of Illuminate\Http\Request, instance of Closure)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php",
"line": 62,
"call": "Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 171,
"call": "Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::handle(instance of Illuminate\Http\Request, instance of Closure)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/fideloper/proxy/src/TrustProxies.php",
"line": 57,
"call": "Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 171,
"call": "Fideloper\Proxy\TrustProxies::handle(instance of Illuminate\Http\Request, instance of Closure)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 105,
"call": "Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 151,
"call": "Illuminate\Pipeline\Pipeline::then(instance of Closure)"
},
{
"file": "/home/unknown/Escritorio/eqpon/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 116,
"call": "Illuminate\Foundation\Http\Kernel::sendRequestThroughRouter(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/public/index.php",
"line": 55,
"call": "Illuminate\Foundation\Http\Kernel::handle(instance of Illuminate\Http\Request)"
},
{
"file": "/home/unknown/Escritorio/eqpon/server.php",
"line": 21,
"function": "require_once('/home/unknown/Escritorio/eqpon/public/index.php')"
}
]
}
]
}

Collapse
joselfonseca profile image
Jose Luis Fonseca Author

Mira que el cliente sea password grant y que este seteado correctamente en .env