This is an example Rails application which implements a GraphQL API.
After cloning the repository, run the following commands:
bundle installbundle exec rails db:createbundle exec rails db:migratebundle exec rake db:seed
The last command will provide you with some sample data to play around with.
You also need to create a .env file in the root of the project that contains a JWT_TOKEN entry for your user.
- Create a
.envfile in the root of the project. rails consoleAuthToken.token(User.last)- Use the token that is output and create a
JWT_TOKENentry in the.envfile.
Start the Rails app with rails server and you can visit http://localhost:3000/graphiql to explore the API locally.
Both the createUser and signInUser mutations return a token field. This is a JWT token which should be submitted in all subsequent requests in the format:
Authentication: bearer TOKEN_HERE