request
signup(
username: "username",
email: "[email protected]",
password: "password",
firstName: "John",
lastName: "Doe",
adminKey: "ADMIN_KEY"
) {
id
username
email
firstName
lastName
}
response
{
"data": {
"signup": {
"id": 1,
"username": "username",
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
}
}
}
request
{
currentUser {
id
username
email
}
}
response
{
"data": {
"currentUser": {
"id": 4,
"username": "lin",
"email": "[email protected]"
}
}
}
request
mutation {
login(email: "[email protected]", password: "password") {
id
email
firstName
lastName
}
}
response
{
"data": {
"login": {
"id": 1,
"email": "[email protected]",
"firstName": "Daniel",
"lastName": "Fisher"
}
}
}
request
mutation {
addPost(
title: "Api Architecture",
headerImage: "www.headerImage.com/image.jpg",
excerpt: "<p>Designing Api Architecture</p>\n",
author: "Ben Simmone",
content: "<h1>Api Architecture content</h1>\n",
createdAt: "2020-04-07",
updatedAt: "2020-04-07"
) {
id
title
headerImage
excerpt
slug
author
content
createdAt
updatedAt
}
}
response
{
"data": {
"addPost": {
"id": 2,
"title": "Api Architecture",
"headerImage": "www.headerImage.com/image.jpg",
"excerpt": "<p>Designing Api Architecture</p>\n",
"slug": "api-architecture",
"author": "Ben Simmone",
"content": "<h1>Api Architecture content</h1>\n",
"createdAt": "2020-04-07",
"updatedAt": "2020-04-07"
}
}
}
request
mutation {
deletePost(id: 1)
}
response
{
"data": {
"deletePost": "post with id 1 deleted successfully"
}
}
request
mutation {
editPost(
id: 2,
title: "Api Architecture",
headerImage: "www.headerImage.com/image.jpg",
excerpt: "<p>Designing Api Architecture</p>\n",
author: "Bola Winslow"
) {
id
title
headerImage
excerpt
slug
author
content
createdAt
updatedAt
}
}
response
{
"data": {
"addPost": {
"id": 2,
"title": "Api Architecture",
"headerImage": "www.headerImage.com/image.jpg",
"excerpt": "<p>Designing Api Architecture</p>\n",
"slug": "api-architecture",
"author": "Bola Winslow",
"content": "<h1>Api Architecture content</h1>\n",
"createdAt": "2020-04-07",
"updatedAt": "2020-04-07"
}
}
}
request
{
getAllNewsletters{
id
title
headerImage
excerpt
slug
author
content
createdAt
updatedAt
}
}
response
{
"data": {
"getAllNewsletters": [
{
"id": 6,
"title": "NewsLetter Documentary",
"headerImage": "www.headerImage.com/image.jpg",
"excerpt": "<p>Designing Api Architecture</p>\n",
"slug": "newsletter-documentary",
"author": "Tochi",
"content": "<h1>NewsLetter Documentary</h1>\n",
"createdAt": "2020-04-07",
"updatedAt": "2020-04-07"
},
{
"id": 8,
"title": "Testing Documentary",
"headerImage": "www.headerImage.com/image.jpg",
"excerpt": "<p>Designing Api Architecture</p>\n",
"slug": "testing-documentary",
"author": "Tochi",
"content": "<h1>NewsLetter Documentary</h1>\n",
"createdAt": "2020-04-08",
"updatedAt": "2020-04-08"
}
]
}
}
request
{
getOneNewsletter(id: 8){
id
title
headerImage
excerpt
slug
author
content
createdAt
updatedAt
}
}
response
{
"data": {
"getOneNewsletter": {
"id": 8,
"title": "Testing Documentary",
"headerImage": "www.headerImage.com/image.jpg",
"excerpt": "<p>Designing Api Architecture</p>\n",
"slug": "testing-documentary",
"author": "Tochi",
"content": "<h1>NewsLetter Documentary</h1>\n",
"createdAt": "2020-04-08",
"updatedAt": "2020-04-08"
}
}
}