- to install dependencies, run:
npm install
- to generate the bundle through gulp, run:
npm run gulp
- to start server, run:
npm run dev
- to run tests, run:
npm test
- to run code coverage, run:
npm run coverage
Then open coverage directory on root of project and open index.html on browser to see the results;
- User Mutations
- User Queries
- Post Mutations
- Post Queries
- Comment Mutations
- Comment Queries
- Token Mutation
createUser(input: {
name: "beltranao"
email: "[email protected]"
password: "beltrano123"
}) {
id
name
email
}
}
mutation UpdateUser {
updateUser(input: {
name: "Ciclano"
email: "[email protected]",
photo: "ciclano.png"
}) {
id
name
email
photo
createdAt
updatedAt
}
}
mutation UpdateUserPassword {
updateUserPassword(input: {
password: "ciclano123"
})
}
mutation DeleteUser {
deleteUser
}
query Users {
users(first: 10, offset: 0){
id
name
email
photo
createdAt
updatedAt
}
}
query User {
user(id: 1) {
id
name
email
photo
createdAt
updatedAt
posts {
id
title
content
photo
comments {
id
comment
user {
id
name
}
}
}
}
}
mutation CreatePost {
createPost(input: {
title: "first post title"
content: "first post content"
photo: "photo.png"
}) {
id
title
content
photo
createdAt
author {
id
name
}
}
}
mutation UpdatePost {
updatePost(id: 1, input: {
title: "updated title"
content: "updated content"
photo: "updatedPhoto.png"
}) {
id
title
content
photo
createdAt
updatedAt
author {
id
name
}
comments {
id
comment
user {
id
name
}
}
}
}
mutation DeletePost {
deletePost(id: 1)
}
query Posts {
posts {
id
title
content
photo
createdAt
updatedAt
author {
id
name
}
comments {
id
comment
user {
id
name
}
}
}
}
query Post {
post(id: 1) {
id
title
content
photo
createdAt
updatedAt
author {
id
name
}
comments {
id
comment
user {
id
name
}
}
}
}
mutation CreateComment {
createComment(input: {
comment: "new comment"
post: 5
}) {
id
comment
createdAt
user {
id
name
}
post {
id
title
}
}
}
mutation UpdateComment {
updateComment(id: 2, input: {
comment: "updated comment"
post: 1
}) {
id
comment
createdAt
updatedAt
user {
id
name
}
post {
id
title
}
}
}
mutation deleteComment {
deleteComment(id: 1)
}
query CommentsByPost {
commentsByPost(postId: 5, first: 10, offset: 0) {
id
comment
createdAt
updatedAt
post {
id
title
}
user {
id
name
}
}
}
mutation createNewToken {
createToken(email: "[email protected]", password: "123456"
) {
token
}
}
```