Authenticate identically to the REST API using a Bearer token in the Authorization header; the GraphQL endpoint is at /api/graphql on your Canvas instance (e.g., https://yourschool.instructure.com/api/graphql).
Query the course by its Canvas ID or by sis_course_id using the course(id:) field, then traverse assignmentsConnection to list assignments and their submissionsConnection to retrieve submission data.
Request pagination cursors in your query using the standard GraphQL Relay pagination pattern (first, after arguments on *Connection fields); the default page size is 20 and the maximum is 100 — use pageInfo { hasNextPage endCursor } to drive iteration.
In the submission objects, request fields such as submittedAt, score, grade, state, userId, and attachmentsConnection for file submissions; note that anonymous grading assignments return null for user-identifying fields while anonymization is active.
For large exports, use the REST API's GET /api/v1/courses/:course_id/students/submissions?student_ids[]=all endpoint as an alternative when GraphQL complexity limits are a concern; Canvas caps GraphQL query complexity at 375,000.
Parse and store the results; cursors are opaque strings and must be passed verbatim in the after argument — do not attempt to decode or construct them.
Known gotchas
GraphQL queries exceeding 5,000 tokens in length or 375,000 complexity points return a 400 error; break deeply nested queries into smaller targeted queries rather than attempting a single all-fields fetch.
The Canvas GraphQL schema is not fully documented and evolves between releases; use the /api/graphql/graphiql explorer on your instance to introspect the live schema rather than relying solely on static documentation.
Submission state values (submitted, graded, unsubmitted, pending_review) are case-sensitive strings; filtering or branching on them requires matching exact casing as returned by the API.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp