Event 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 Events API allows you to retrieve information about calendar events in your school. You can list all events, get details for a specific event, and filter events by date range, type, or associated courses.
Available Queries
events
Returns a paginated list of events for the school.
Parameters:
Parameter | Type | Description |
---|---|---|
first | Int | Number of items to return (default: 20, max: 100) |
after | String | Cursor for pagination |
filter | EventFilter | Filter criteria (see Filtering) |
Returns:
- Connection object with:
nodes
: Array of Event objectspageInfo
: Pagination metadata
Example:
query { events(first: 10) { nodes { id title description startTime endTime location eventType } pageInfo { hasNextPage endCursor } }}
event
Returns a single event by ID.
Parameters:
Parameter | Type | Description |
---|---|---|
id | ID! | The ID of the event (required) |
Returns:
- Event object or null if not found
Example:
query { event(id: "event-123") { id title description startTime endTime location eventType course { id name } attendees { id name email } }}
Event Object
The Event object contains the following fields:
Field | Type | Description |
---|---|---|
id | ID | Unique identifier |
title | String | Event title |
description | String | Event description |
startTime | DateTime | Event start time |
endTime | DateTime | Event end time |
location | String | Physical or virtual location |
eventType | EventType | Type of event (see Event Types) |
isAllDay | Boolean | Whether the event is an all-day event |
createdAt | DateTime | When the event was created |
updatedAt | DateTime | When the event was last updated |
course | Course | Associated course (if applicable) |
attendees | [User] | List of event attendees |
Event Types
The eventType
field can have one of the following values:
Type | Description |
---|---|
CLASS_SESSION | Regular class session |
EXAM | Test or exam |
ASSIGNMENT_DUE | Assignment due date |
SCHOOL_HOLIDAY | School holiday or closure |
SPECIAL_EVENT | Special school event |
STAFF_MEETING | Staff or faculty meeting |
OTHER | Other event type |
Filtering
The events
query accepts a filter
parameter of type EventFilter
. This allows you to narrow down results based on various criteria.
Available Filters
Filter Field | Type | Description |
---|---|---|
id | IDFilter | Filter by event ID |
title | StringFilter | Filter by event title |
description | StringFilter | Filter by event description |
startTime | DateTimeFilter | Filter by start time |
endTime | DateTimeFilter | Filter by end time |
location | StringFilter | Filter by location |
eventType | EventTypeFilter | Filter by event type |
courseId | IDFilter | Filter by associated course ID |
isAllDay | Boolean | Filter for all-day events |
Filter Examples
Find events for a specific date range:
query { events( filter: { startTime: { between: ["2023-10-01T00:00:00Z", "2023-10-31T23:59:59Z"] } } ) { nodes { id title startTime endTime } }}
Find class sessions for a specific course:
query { events( filter: { eventType: { equals: CLASS_SESSION }, courseId: { equals: "course-123" } } ) { nodes { id title startTime endTime } }}
Find upcoming exams:
query { events( filter: { eventType: { equals: EXAM }, startTime: { after: "2023-09-01T00:00:00Z" } } ) { nodes { id title startTime course { id name } } }}