canvas-lms
canvas-lms copied to clipboard
GraphQL: add the support for retrieving enrollment data for given section within a course
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.