You can also access the GraphQL API of the API server directly. It is running on the same host machine and port and can be accessed via the /api
route (in this case that is localhost:3000/api
).
Below are a number of operations that you can send to the API.
query {
feed {
id
title
content
published
author {
id
name
email
}
}
}
See more API operations
mutation {
signupUser(name: "Sarah", email: "[email protected]") {
id
}
}
mutation {
createDraft(
title: "Join the Prisma Slack"
content: "https://slack.prisma.io"
authorEmail: "[email protected]"
) {
id
published
}
}
mutation {
publish(postId: "__POST_ID__") {
id
published
}
}
Note: You need to replace the
__POST_ID__
-placeholder with an actualid
from aPost
item. You can find one e.g. using thefilterPosts
-query.
{
filterPosts(searchString: "graphql") {
id
title
content
published
author {
id
name
email
}
}
}
{
post(postId: "__POST_ID__") {
id
title
content
published
author {
id
name
email
}
}
}
Note: You need to replace the
__POST_ID__
-placeholder with an actualid
from aPost
item. You can find one e.g. using thefilterPosts
-query.
mutation {
deletePost(postId: "__POST_ID__") {
id
}
}
Note: You need to replace the
__POST_ID__
-placeholder with an actualid
from aPost
item. You can find one e.g. using thefilterPosts
-query.