Project to study the NestJs integration with GraphQL and MongoDB.
- Nodejs
- npm
- MongoDB running locally
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
On http://localhost:3000/graphql
you will be able to see the GraphQL playground:
mutation {
createAstronaut(input: { name: "Lucas", surname: "Guiss", agency: "Spacex", age: 21}) {
id,
name,
surname,
agency,
age
}
}
{
findAllAstronauts{
id,
name,
surname,
agency,
age
}
}
The output should be something like this:
{
"data": {
"findAllAstronauts": [
{
"id": "6032ac038af6b9202c916f72",
"name": "Lucas",
"surname": "Guiss",
"agency": "spacex",
"age": 21
}
]
}
}