The schema that specifies the API operations of your GraphQL server is defined in ./schema.graphql
. Below are a number of operations that you can send to the API using the GraphQL Playground.
Feel free to adjust any operation by adding or removing fields. The GraphQL Playground helps you with its auto-completion and query validation features.
query {
feed {
id
title
content
published
author {
id
name
email
}
}
}
See more API operations
{
draftsByUser(
userUniqueInput: {
email: "[email protected]"
}
) {
id
title
content
published
author {
id
name
email
}
}
}
mutation {
signupUser(data: { name: "Sarah", email: "[email protected]" }) {
id
}
}
mutation {
createDraft(
data: { title: "Join the Prisma Discord", content: "https://pris.ly/discord" }
authorEmail: "[email protected]"
) {
id
viewCount
published
author {
id
name
}
}
}
mutation {
togglePublishPost(id: __POST_ID__) {
id
published
}
}
Note that you need to replace the __POST_ID__
placeholder with an actual id
from a Post
record in the database, e.g.5
:
mutation {
togglePublishPost(id: 5) {
id
published
}
}
mutation {
incrementPostViewCount(id: __POST_ID__) {
id
viewCount
}
}
Note that you need to replace the __POST_ID__
placeholder with an actual id
from a Post
record in the database, e.g.5
:
mutation {
incrementPostViewCount(id: 5) {
id
viewCount
}
}
{
feed(
searchString: "prisma"
) {
id
title
content
published
}
}
{
feed(
skip: 2
take: 2
orderBy: { updatedAt: desc }
) {
id
updatedAt
title
content
published
}
}
{
postById(id: __POST_ID__ ) {
id
title
content
published
}
}
Note that you need to replace the __POST_ID__
placeholder with an actual id
from a Post
record in the database, e.g.5
:
{
postById(id: 5 ) {
id
title
content
published
}
}
mutation {
deletePost(id: __POST_ID__) {
id
}
}
Note that you need to replace the __POST_ID__
placeholder with an actual id
from a Post
record in the database, e.g.5
:
mutation {
deletePost(id: 5) {
id
}
}