A graphql project depicting login/registration mutations
Clone the project repository by running the command below
git clone https://github.com/classyserve/graphql-user.git
After cloning, run:
npm install
Rename .env.example
to .env
then fill in your database detail and your JWT secret:
NODE_ENV=development
DB_HOST=localhost
DB_USERNAME=root
DB_PASSWORD=
DB_NAME=graphql_blog_cms
JWT_SECRET=somereallylongsecretkey
Then run the migration:
sequelize db:migrate
And finally, start the application:
npm start
Then visit http://localhost:3000/graphiql to see the application in action.
Then try out:
mutation{
register(firstName: "firstname", lastName: "lastname", email: "emailid", password:"password){
id, firstName, lastName, email
}
}