Database model
Clone the project
git clone https://github.com/adrian-azu/FamilyTree-GraphQL-API.git
Go to the project directory
cd FamilyTree-GraphQL-API
Install dependencies
npm install
Setup ENV
copy .env.example .env
or
create a .env file and copy the .env.example content
Start the server
npm run start
Create and start containers with docker compose up The docker compose up command aggregates the output of each container. It builds, (re)creates, starts, and attaches to containers for a service.
In order to run this container you'll need docker installed.
docker compose up
Attaching to web_1 web_1 | Running Express GraphQL server at http://localhost:3000/graphql
Query example
query {
persons {
_id
firstName
lastName
gender
born
died
}
}
Mutation example
mutation {
createPerson(person: {firstName: "Adrian", lastName: "Azucena", gender: Male, born: "August 14, 1998"}) {
_id
firstName
lastName
gender
born
died
}
}
Server: Node, Express, MongoDB, GraphQL, Docker