Skip to content

Add new GraphQL queries to list organization memberships for a user and list SCIM accounts for an EMU #791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jusuchin85
Copy link
Contributor

Summary

This pull request adds two new GraphQL queries to the codebase, each designed to help retrieve important user and organization data from GitHub. The queries are well-documented and provide clear usage instructions for customizing the parameters.

Outline

New GraphQL queries for account and membership information:

  • Added emu-list-scim-accounts.graphql query to list enterprise members and their SCIM account details for GitHub Enterprise Cloud with Managed Users (EMU), including notes on usage and limitations.
  • Added user-org-membership.graphql query to list organizations a specified user belongs to, with guidance on parameter replacement and output caveats.

user

Added a GraphQL query to list the organizations a user belongs to on
GitHub.com. This query retrieves the organization name and slug for each
organization.
This commit adds a GraphQL query to list SCIM accounts for an EMU
(Enterprise Managed Users) enterprise account. The query retrieves
details about enterprise members and their SCIM account information,
which is useful for managing user accounts in GitHub Enterprise Cloud.
@jusuchin85 jusuchin85 self-assigned this Aug 22, 2025
@Copilot Copilot AI review requested due to automatic review settings August 22, 2025 04:56
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds two GraphQL queries to retrieve user membership and enterprise account information from GitHub. The queries provide structured access to organization memberships and SCIM account details for Enterprise Managed Users (EMU).

  • Added query to list organizations a user belongs to with visibility restrictions based on caller permissions
  • Added query to list enterprise members and their SCIM account details for EMU enterprises

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
graphql/queries/user-org-membership.graphql Query to retrieve organization memberships for a specified user
graphql/queries/emu-list-scim-accounts.graphql Query to list enterprise members and SCIM account details for EMU enterprises

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@bss-mc bss-mc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave them a go and found no issues.

Only possible comment, should we include what scopes the PAT you use requires (e.g. read:enterprise for the first one)?

@jusuchin85
Copy link
Contributor Author

Done! Thanks @bss-mc

@bss-mc
Copy link
Contributor

bss-mc commented Aug 22, 2025

Do you need admin:enterprise for the first query? I tested with read:enterprise and I didn't notice any issues (but that doesn't mean there weren't any).

@jusuchin85
Copy link
Contributor Author

jusuchin85 commented Aug 22, 2025

Would this note covered that? https://github.com/github/platform-samples/pull/791/files#diff-13200abcdb94a745382c6cdf63d997d34f9b4b6d13f0906da76902700425f846R3

EDIT: 🤦 misunderstood your comment! I did a squad commit to update the actual scope. Thanks @bss-mc ❤️

@jusuchin85 jusuchin85 force-pushed the jusuchin85/2025-07-09_graphql_list-user-org-membership_list-scim-emu-accounts branch from fd48719 to c096ff5 Compare August 22, 2025 06:16
@bss-mc
Copy link
Contributor

bss-mc commented Aug 22, 2025

Perfect, I vote to merge 🎉

@jusuchin85 jusuchin85 merged commit 17d2a3a into master Aug 22, 2025
5 checks passed
@jusuchin85 jusuchin85 deleted the jusuchin85/2025-07-09_graphql_list-user-org-membership_list-scim-emu-accounts branch August 22, 2025 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants