Fetching Organization members who are owners using GraphQL #24822
-
How can I find out if the user is an owner of the organization? I am using the following to get a list of members of a given organization - query ($org: String!, $after: String) { organization(login: $org) { membersWithRole(first: 100, after: $after) { nodes { login name } pageInfo { hasNextPage endCursor } } } } |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
This is one of the cases where the
I hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Thanks, this is exactly what I was looking for. |
Beta Was this translation helpful? Give feedback.
-
@lee-dohm - Is it also possible to get users based on their roles? For example, get me the list of owners for an organization. Thanks, |
Beta Was this translation helpful? Give feedback.
-
@galok73 Since there’s no filter options on the |
Beta Was this translation helpful? Give feedback.
-
Thanks for confirming. |
Beta Was this translation helpful? Give feedback.
-
@lee-dohm The problem here is that the role will be either of ADMIN or MEMBER, in a situation where there are multiple admins how to we filter if the person is the creator/owner of the organization? |
Beta Was this translation helpful? Give feedback.
-
A member with the There isn’t any special status for the creator of the organization, they’re simply granted the I hope that helps! |
Beta Was this translation helpful? Give feedback.
This is one of the cases where the
edges
andnodes
properties of the connection are more different than simply having atotalCount
field. This query should work for you:I hope that helps!