https://github.com/RisingStack/graphql-server
Example GraphQL server with Mongoose (MongoDB) and Node.js
https://github.com/RisingStack/graphql-server
Last synced: 17 days ago
JSON representation
Example GraphQL server with Mongoose (MongoDB) and Node.js
- Host: GitHub
- URL: https://github.com/RisingStack/graphql-server
- Owner: RisingStack
- License: mit
- Created: 2015-07-03T09:26:20.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-29T16:10:32.000Z (almost 9 years ago)
- Last Synced: 2025-03-27T15:01:57.182Z (19 days ago)
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 845
- Watchers: 29
- Forks: 96
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-graphql - graphql-server - GraphQL server with Mongoose (MongoDB) and Node.js. (Examples / JavaScript Examples)
README
# graphql-server
[ ](https://codeship.com/projects/89250)
GraphQL server with Mongoose (MongoDB) and Node.js## Like this? Check out our GraphQL ORM: [graffiti](https://github.com/RisingStack/graffiti)
**Example GraphQL query:**
```
user(id: "1") {
name
friends {
name
}
}
```**Example response:**
```json
{
"data": {
"user": {
"name": "John Doe",
"friends": [
{
"name": "Friend One"
},
{
"name": "Friend Two"
}]
}
}
}
```**Example GraphQL mutation:**
```
mutation updateUser($userId: String! $name: String!) {
updateUser(id: $userId name: $name) {
name
}
}
```## Used technologies
* GraphQL
* MongoDB with Mongoose
* Node/IO.js
* Babel## How to start
You need `iojs` or >= `Node.js` v0.12.x
### install dependencies
```
npm install
```### seed database
```
npm run seed
```### start server
```
npm start
```### run client
```
npm run client
```## How to test
```
npm test
```