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:
Parameter | Type | Description |
---|---|---|
first | Int | Number of items to return (default: 20, max: 100) |
after | String | Cursor for pagination |
filter | AssignmentFilter | Filter criteria (see Filtering) |
Returns:
- Connection object with:
nodes
: Array of Assignment objectspageInfo
: 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:
Parameter | Type | Description |
---|---|---|
id | ID! | 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:
Field | Type | Description |
---|---|---|
id | ID | Unique identifier |
title | String | Assignment title |
description | String | Assignment description |
dueDate | DateTime | When the assignment is due |
pointsPossible | Float | Maximum points possible |
isPublished | Boolean | Whether the assignment is visible to students |
createdAt | DateTime | When the assignment was created |
updatedAt | DateTime | When the assignment was last updated |
course | Course | The course this assignment belongs to |
submissions | SubmissionConnection | Paginated list of student submissions |
Submission Object
The Submission object contains the following fields:
Field | Type | Description |
---|---|---|
id | ID | Unique identifier |
student | Student | The student who submitted |
assignment | Assignment | The assignment this submission is for |
submittedAt | DateTime | When the submission was made |
grade | Float | Points awarded (null if not graded) |
feedback | String | Teacher feedback |
attachments | [Attachment] | Attached files |
status | SubmissionStatus | Status (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 Field | Type | Description |
---|---|---|
id | IDFilter | Filter by assignment ID |
title | StringFilter | Filter by assignment title |
description | StringFilter | Filter by assignment description |
dueDate | DateTimeFilter | Filter by due date |
courseId | IDFilter | Filter by course ID |
isPublished | Boolean | Filter for published/unpublished assignments |
createdAt | DateTimeFilter | Filter 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 } }}