https://github.com/lucasguiss/astronauts-nest
NestJs + GraphQL + MongoDB
https://github.com/lucasguiss/astronauts-nest
backend graphql nestjs nodejs typescript
Last synced: about 2 months ago
JSON representation
NestJs + GraphQL + MongoDB
- Host: GitHub
- URL: https://github.com/lucasguiss/astronauts-nest
- Owner: lucasguiss
- Created: 2021-02-15T23:34:00.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-21T19:42:33.000Z (over 5 years ago)
- Last Synced: 2025-01-05T23:43:19.066Z (over 1 year ago)
- Topics: backend, graphql, nestjs, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 143 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## About the repository:
Project to study the NestJs integration with GraphQL and MongoDB.
## Requirements:
- Nodejs
- npm
- MongoDB running locally
## Installation
```bash
$ npm install
```
## Running the app
```bash
# development
$ npm run start
# watch mode
$ npm run start:dev
```
## Examples:
On `http://localhost:3000/graphql` you will be able to see the GraphQL playground:

### Create Astronaut:
```
mutation {
createAstronaut(input: { name: "Lucas", surname: "Guiss", agency: "Spacex", age: 21}) {
id,
name,
surname,
agency,
age
}
}
```
### Find All Astronauts:
```
{
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
}
]
}
}
```