Skip to content

Assignment Queries

Note: The Teachify Admin API is currently under development and not yet available for public use. This documentation is provided for preview purposes only.

Overview

The Assignments API allows you to retrieve information about assignments in your school. You can list all assignments, get details for a specific assignment, and access related data like student submissions and grades.

Available Queries

assignments

Returns a paginated list of assignments for the school.

Parameters:

ParameterTypeDescription
firstIntNumber of items to return (default: 20, max: 100)
afterStringCursor for pagination
filterAssignmentFilterFilter criteria (see Filtering)

Returns:

  • Connection object with:
    • nodes: Array of Assignment objects
    • pageInfo: Pagination metadata

Example:

query {
assignments(first: 10) {
nodes {
id
title
description
dueDate
pointsPossible
course {
id
name
}
}
pageInfo {
hasNextPage
endCursor
}
}
}

assignment

Returns a single assignment by ID.

Parameters:

ParameterTypeDescription
idID!The ID of the assignment (required)

Returns:

  • Assignment object or null if not found

Example:

query {
assignment(id: "assignment-123") {
id
title
description
dueDate
pointsPossible
course {
id
name
}
submissions {
nodes {
id
student {
id
name
}
submittedAt
grade
}
}
}
}

Assignment Object

The Assignment object contains the following fields:

FieldTypeDescription
idIDUnique identifier
titleStringAssignment title
descriptionStringAssignment description
dueDateDateTimeWhen the assignment is due
pointsPossibleFloatMaximum points possible
isPublishedBooleanWhether the assignment is visible to students
createdAtDateTimeWhen the assignment was created
updatedAtDateTimeWhen the assignment was last updated
courseCourseThe course this assignment belongs to
submissionsSubmissionConnectionPaginated list of student submissions

Submission Object

The Submission object contains the following fields:

FieldTypeDescription
idIDUnique identifier
studentStudentThe student who submitted
assignmentAssignmentThe assignment this submission is for
submittedAtDateTimeWhen the submission was made
gradeFloatPoints awarded (null if not graded)
feedbackStringTeacher feedback
attachments[Attachment]Attached files
statusSubmissionStatusStatus (SUBMITTED, GRADED, LATE, etc.)

Filtering

The assignments query accepts a filter parameter of type AssignmentFilter. This allows you to narrow down results based on various criteria.

Available Filters

Filter FieldTypeDescription
idIDFilterFilter by assignment ID
titleStringFilterFilter by assignment title
descriptionStringFilterFilter by assignment description
dueDateDateTimeFilterFilter by due date
courseIdIDFilterFilter by course ID
isPublishedBooleanFilter for published/unpublished assignments
createdAtDateTimeFilterFilter by creation date

Filter Examples

Find assignments due in the next week:

query {
assignments(
filter: {
dueDate: {
after: "2023-09-01T00:00:00Z",
before: "2023-09-08T23:59:59Z"
}
}
) {
nodes {
id
title
dueDate
course {
id
name
}
}
}
}

Find assignments for a specific course:

query {
assignments(
filter: {
courseId: { equals: "course-123" }
}
) {
nodes {
id
title
dueDate
}
}
}

Search for assignments by title:

query {
assignments(
filter: {
title: { contains: "Midterm" }
}
) {
nodes {
id
title
dueDate
}
}
}