Using apollo-server-express
for setting up the GraphQL Server. Mongoose
is used for performing database operations.
NodeJs
MongoDB
The above should be installed in your system.
git clone https://github.com/suri66/node-graphql-mongoose.git
npm i
node /bin/www or nodemon
Now navigate to
http://localhost:3000/graphql
. You will get an graphql interface.
Here you can perform the queries and mutation
You can see all graphQL endpoints by clicking on Docs on the right side
Copy Paste below query on the left side of interface and then run it
{ movies { name producer rating id } }
mutation { addMovie( name: "RBJ", producer: "YRF", rating: 4 ) { id name } }