- NodeJS 8+ is required to run this service.
- Install MySQL
Then:
- Run
npm install
- Run
npm run gulp
- Run
npm run dev
- Open in your browser
localhost:3000/GraphQL
NODE_ENV
- Specifying the environment in which you want to run the applicationJWT_SECRET
- Key to JWT encryption
- users
query getUsersList($first: Int, $offset: Int) {
users(first: $first, offset: $offset) {
id
name
email
createdAt
posts {
id
title
createdAt
}
}
}
- user
query getUserById($id: ID!) {
user(id: $id) {
id
name
email
createdAt
posts {
title
createdAt
}
}
}
- post
query getPostsList($first: Int, $offset: Int) {
posts(first: $first, offset: $offset) {
id
title
content
author {
name
email
}
comments {
comment
}
}
}
- post
query getPostById($id: ID!) {
post(id: $id) {
id
title
content
author {
name
email
}
comments {
comment
}
}
}
- comment
query getCommentsListByPost($postId: ID!, $first: Int, $offset: Int) {
commentsByPost(postId: $postId, first: $first, offset: $offset) {
id
comment
user {
name
email
}
post {
title
}
}
}
- Implements DataLoaders
- Implements Tests
- Refactor Functions in Queries and Mutations, Very Verbose