Skip to content

Assignments Query

The Assignments API allows you to retrieve information about course assignments in your school. You can list all assignments across the school, filter by course or published state, and combine it with the submissions query to read student submissions and grading results.

Requires the courses:read scope.

Returns a paginated list of assignments for the school.

Parameters:

ParameterTypeDescription
filterAdminAssignmentFilterFilter criteria (see Filtering)
sortingSortingInputSort by a column (column, order: "asc"/"desc")
pageInt1-indexed page number (default: 1)
perPageIntItems per page (default: 20, max: 50)

Returns:

  • AdminAssignmentPage object with:
    • nodes: Array of AdminAssignment objects
    • currentPage: Current page number
    • totalPages: Total number of pages
    • nodesCount: Total number of items across all pages
    • hasNextPage: Whether there are more pages
    • hasPreviousPage: Whether there are previous pages

Results default to newest-first (createdAt descending).

Example:

query {
assignments(page: 1, perPage: 10) {
nodes {
id
name
description
published
dueAt
courseId
}
currentPage
totalPages
hasNextPage
}
}
FieldTypeDescription
idString!Unique identifier
courseIdString!The course this assignment belongs to
nameStringAssignment name
descriptionStringAssignment description
publishedBoolean!Whether the assignment is visible to students
startedAtBigIntUnix timestamp when the assignment opens
dueAtBigIntUnix timestamp when the assignment is due
positionInt!Sort position when the course orders assignments by position
contentRestrictionString!Whether text content is required on submissions: required, optional, none
attachmentRestrictionString!Whether file attachments are required on submissions: required, optional, none
fileTypes[String!]!Accepted MIME types for submission attachments
commentableBoolean!Whether students can comment on submissions
createdAtBigInt!Unix timestamp when the assignment was created
updatedAtBigInt!Unix timestamp when the assignment was last updated

Note: BigInt values are serialized as strings in the JSON response (e.g. "1767225600") to avoid JavaScript number-precision issues. As mutation inputs they accept either a number or a numeric string.

The assignments query accepts a filter parameter of type AdminAssignmentFilter.

Filter FieldTypeDescription
idStringOperatorFilter by assignment ID (eq, in, …)
nameStringOperatorFilter by assignment name (eq, contains, …)
courseIds[String!]Filter by course IDs
publishedBooleanFilter for published/unpublished assignments

Find assignments for a specific course:

query {
assignments(filter: { courseIds: ["course-123"] }) {
nodes {
id
name
dueAt
}
}
}

Find published assignments by name:

query {
assignments(
filter: {
published: true
name: { contains: "Midterm" }
}
) {
nodes {
id
name
dueAt
}
}
}
  • submissions(assignmentId: ...) — list student submissions for an assignment
  • Course Object — the assignments field on a course