Skip to content

GraphQL: Enterprise cloud user query - Hint needed #49491

Answered by DrNeil
Timmmy-nlb asked this question in Enterprise
Discussion options

You must be logged in to vote

found this issue today and how to get it working
firstly you need to have the correct authention scopes
I am using GH CLI and this gets the correct tokens
gh auth login -p https -h GitHub.com -s repo,user,admin:enterprise,admin:org -w

Then the query looks like this

$query = @'
query($cursor: String) {
  enterprise(slug: "<YOUR ENTERPRISE SLUG") {
    members(first: 100, after: $cursor, role:MEMBER) {
      pageInfo {
        hasNextPage
        endCursor
      }
      nodes{ 
        ... on EnterpriseUserAccount{ 
          login
          id, 
          organizations(first:2){ 
            nodes{
              ... on Organization{
                login
              }
            }
     …

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Timmmy-nlb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API and Webhooks Discussions related to GitHub's APIs or Webhooks Enterprise Discussions related to GitHub Enterprise Cloud, Enterprise Server and Organizations Question Ask and answer questions about GitHub features and usage
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy