In my previous post I published a basic example with Laravel + GraphQL. The current post is to create the login query.
1. Install Passport
2. Create the UserType
3. Create the login query
This query receive two params
password. And return the user DB values + accesToken.
4. The Login class
This is a basic login class, in the code it was optimized to make it more scalable.
5. Add the query and type
In order to make it available, we need to add the query and the type in the graphql configuration file.
6. Run the query
Now you can go to http://127.0.0.1:8000/graphiql/ and run the query and see the DB values in JSON format.