canvas-lms icon indicating copy to clipboard operation
canvas-lms copied to clipboard

GraphQL API: submissionsConnection, user nodes have `loginId` as nulls for all users

Open uta-pmizilin opened this issue 2 years ago • 2 comments

Summary:

Steps to reproduce:

Using the following query:

query MyQuery {
  course(id: "654321") {
    sisId
    assignmentsConnection {
      nodes {
        name
        pointsPossible
        submissionTypes
        submissionsConnection(first: 10) {
          nodes {
            user {
              _id
              sisId
              loginId
              email
              shortName
            }
            score
          }
        }
      }
    }
  }
}

Expected behavior:

'loginId' attributes should not be null

Actual behavior:

'loginId' attributes are nulls

Additional notes:

uta-pmizilin avatar Sep 29 '23 21:09 uta-pmizilin

This is most likely a permission issue, that you are not an admin in your Canvas instance, so are not allowed to view other users' logins. In particular the check is return nil unless pseudonym && course.grants_right?(context[:current_user], context[:session], :view_user_logins)

ccutrer avatar Oct 26 '23 20:10 ccutrer

I'm definitely an admin and I'm able to read loginId in usersConnection on the course level for example

uta-pmizilin avatar Oct 26 '23 21:10 uta-pmizilin