Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dalelantowork/nodejs-graphql
Simple App using Node JS, Express JS and GraphQL
https://github.com/dalelantowork/nodejs-graphql
expressjs graphql nodejs
Last synced: 3 days ago
JSON representation
Simple App using Node JS, Express JS and GraphQL
- Host: GitHub
- URL: https://github.com/dalelantowork/nodejs-graphql
- Owner: dalelantowork
- Created: 2023-11-16T07:44:25.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2023-11-16T07:47:24.000Z (12 months ago)
- Last Synced: 2023-11-16T08:38:35.261Z (12 months ago)
- Topics: expressjs, graphql, nodejs
- Language: JavaScript
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## nodejs-graphql
npm init -y
npm i express## install nodemon globally
npm i nodemon## install nodemon dev
npm i nodemon -D## add in package.json under scripts
"dev": "nodemon server.js"## use nodemon
npm run dev## install graphql with express
npm install graphql express-graphql## import graphql
const graphql = require("graphql");
const { graphqlHTTP } = require("express-graphql");## access
http://localhost:6969/graphql## query -> get all users
query {
getAllUsers {
firstName
lastName
password
}
}## mutation -> create users
mutation {
createUser(firstName: "Dale", lastName:"Lanto", email: "[email protected]", password:"password") {
firstName
lastName
}
}mutation {
createUser(firstName: "Jesabel", lastName:"Ducena", email: "[email protected]", password:"password") {
firstName
lastName
}
}