Skip to main content

Task GraphQL Examples

These examples show how to query, create, update, and delete tasks through the GraphQL API.

Query Tasks​

query GetTasks($first: Int, $where: TaskWhereInput, $orderBy: [TaskOrder!]) {
tasks(first: $first, where: $where, orderBy: $orderBy) {
edges {
node {
id
displayID
title
details
category
status
due
createdAt
updatedAt
owner {
id
name
}
}
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
totalCount
}
}

Create Task​

mutation CreateTask($input: CreateTaskInput!) {
createTask(input: $input) {
task {
id
displayID
title
details
category
status
due
createdAt
}
}
}

Update Task​

mutation UpdateTask($id: ID!, $input: UpdateTaskInput!) {
updateTask(id: $id, input: $input) {
task {
id
displayID
title
details
status
updatedAt
}
}
}

Delete Task​

mutation DeleteTask($id: ID!) {
deleteTask(id: $id) {
deletedID
}
}