Skip to content

Expand orgs/users in dashboard.grants to include nam

Created by: unclejustin

Currently insightsDashboards returns grants where the organizations and users are a simple list of ids as a string array. We have to pair up the id to a name on the front end to properly display these.

Beyond just being extra code there is a small possibility that the orgs list available on the authenticatedUser object is out of date since that object only updates on page reload.

Current behavior

query GetDashboards {
  insightsDashboards {
    nodes {
      grants {
        users # string[]
        organizations # string[]
      }
    }
  }
}

Desired behavior

query GetDashboards {
  insightsDashboards {
    nodes {
      grants {
        users {
          id
          displayName
        }
        organizations {
          id
          displayName
        }
      }
    }
  }
}