GraphQL Backend Server with Mongoose Template
This is a starter template for setting up a simple node server using GraphQL to connect to your mongoDB.
For more details and documentation, visit https://graphql.org/
- Make sure you have Node/NPM
- Make sure you have mongoDB instance set up and running, either locally or hosted somewhere
- Create a
.env
file in root directory and writeMONGO_DB_URI=<your db uri>
. Alternatively, just updateconst db
to point to your DB URI directly. - Run:
npm install
npm start
Open in your browser:
localhost:4000/graphiql
This is your graphql playground, where you can try out graphql queries and mutations you've defined. The base template only includes a User data model.
To learn more, visit https://graphql.org/learn/
This is the barebones setup to have a GraphQL backend set up with a NoSQL database, with some helpful tools.
- Node
- Express
- MongoDB
- Mongoose
- GraphQL
- Babel - used for ES6 imports