Loopwise Docs
Admin APIQueries

Events Query

How to query calendar event data in the Loopwise Admin API

Note: The Loopwise 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:

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

Returns:

  • Connection object with:
    • nodes: Array of Event objects
    • pageInfo: 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:

ParameterTypeDescription
idString!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:

FieldTypeDescription
idStringUnique identifier
titleStringEvent title
descriptionStringEvent description
startTimeDateTimeEvent start time
endTimeDateTimeEvent end time
locationStringPhysical or virtual location
eventTypeEventTypeType of event (see Event Types)
isAllDayBooleanWhether the event is an all-day event
createdAtDateTimeWhen the event was created
updatedAtDateTimeWhen the event was last updated
courseCourseAssociated course (if applicable)
attendees[User]List of event attendees

Event Types

The eventType field can have one of the following values:

TypeDescription
CLASS_SESSIONRegular class session
EXAMTest or exam
ASSIGNMENT_DUEAssignment due date
SCHOOL_HOLIDAYSchool holiday or closure
SPECIAL_EVENTSpecial school event
STAFF_MEETINGStaff or faculty meeting
OTHEROther 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 FieldTypeDescription
idIDFilterFilter by event ID
titleStringFilterFilter by event title
descriptionStringFilterFilter by event description
startTimeDateTimeFilterFilter by start time
endTimeDateTimeFilterFilter by end time
locationStringFilterFilter by location
eventTypeEventTypeFilterFilter by event type
courseIdIDFilterFilter by associated course ID
isAllDayBooleanFilter 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
      }
    }
  }
}

On this page