Assignments Query
Overview
Section titled “Overview”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.
Available Queries
Section titled “Available Queries”assignments
Section titled “assignments”Returns a paginated list of assignments for the school.
Parameters:
| Parameter | Type | Description |
|---|---|---|
filter | AdminAssignmentFilter | Filter criteria (see Filtering) |
sorting | SortingInput | Sort by a column (column, order: "asc"/"desc") |
page | Int | 1-indexed page number (default: 1) |
perPage | Int | Items per page (default: 20, max: 50) |
Returns:
- AdminAssignmentPage object with:
nodes: Array of AdminAssignment objectscurrentPage: Current page numbertotalPages: Total number of pagesnodesCount: Total number of items across all pageshasNextPage: Whether there are more pageshasPreviousPage: 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 }}AdminAssignment Object
Section titled “AdminAssignment Object”| Field | Type | Description |
|---|---|---|
id | String! | Unique identifier |
courseId | String! | The course this assignment belongs to |
name | String | Assignment name |
description | String | Assignment description |
published | Boolean! | Whether the assignment is visible to students |
startedAt | BigInt | Unix timestamp when the assignment opens |
dueAt | BigInt | Unix timestamp when the assignment is due |
position | Int! | Sort position when the course orders assignments by position |
contentRestriction | String! | Whether text content is required on submissions: required, optional, none |
attachmentRestriction | String! | Whether file attachments are required on submissions: required, optional, none |
fileTypes | [String!]! | Accepted MIME types for submission attachments |
commentable | Boolean! | Whether students can comment on submissions |
createdAt | BigInt! | Unix timestamp when the assignment was created |
updatedAt | BigInt! | Unix timestamp when the assignment was last updated |
Note:
BigIntvalues 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.
Filtering
Section titled “Filtering”The assignments query accepts a filter parameter of type AdminAssignmentFilter.
Available Filters
Section titled “Available Filters”| Filter Field | Type | Description |
|---|---|---|
id | StringOperator | Filter by assignment ID (eq, in, …) |
name | StringOperator | Filter by assignment name (eq, contains, …) |
courseIds | [String!] | Filter by course IDs |
published | Boolean | Filter for published/unpublished assignments |
Filter Examples
Section titled “Filter Examples”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 } }}Related Queries
Section titled “Related Queries”submissions(assignmentId: ...)— list student submissions for an assignment- Course Object — the
assignmentsfield on a course