instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.57k stars 2.47k forks source link

GraphQL: add the support for retrieving enrollment data for given section within a course #2290

Open zqian opened 10 months ago

zqian commented 10 months ago

Summary:

A Canvas course could contain multiple sections. We have the need to retrieve Enrollment data (with course grade information) for given section.

However, Canvas GraphQL does not support the section query now. We have to use the following query for course, and then filter out section enrollments:

Steps to reproduce:

query MyQuery { course(id: 111111) { enrollmentsConnection(last: 999) { pageInfo { endCursor startCursor } nodes { grades { finalScore finalGrade customGradeStatusId currentScore currentGrade enrollment { user { loginId name sisId } } } } } } }

Expected behavior:

It would be ideal for Canvas GraphQL to provide section endpoint, with id and sis_id params, and enrollmentConnection object.