Demo 👉 https://graphql-timeline-api.herokuapp.com/playground
- Apollo Server
- GraphQL
- MongoDB with Mongoose
# clone repo
$ git clone https://github.com/gabrielferreiraa/timeline-graphql-api.git
$ cd timeline-graphql-api
# install dependencies
$ yarn
# start project
$ yarn start
See graphql interface on localhost link: http://localhost:9000/playground
-
UpdatePost
- mutation -
DeletePost
- mutation -
DeleteUser
- mutation -
getPostById
- query - GraphQL improviments
- add tests
Simple documentation to see query structures
query {
getAllUsers {
id
name
email
}
}
query {
getUserByEmail(
email: "[email protected]"
) {
id
name
email
}
}
query {
getAllPosts {
id
title
content
user {
name
email
}
}
}
Simple documentation to see mutation structures
mutation {
Auth(
email: "[email protected]"
password: "1234"
) {
token
error
}
}
mutation {
CreateUser(
name: "Raul Gil",
email: "[email protected]",
password: "1234"
) {
id
name
email
}
}
mutation {
UpdateUser(
name: "Raul Gil - Edited",
email: "[email protected]"
) {
name
email
}
}
mutation {
CreatePost(
title: "Post Title"
content: "Post Content"
) {
title
content
user {
name
email
}
}
}