Add pending members GraphQl endpoint
What does this MR do and why?
For #348309 (closed)
Add pending members GraphQl endpoint that mirrors existing REST endpoint
Screenshots or screen recordings
How to set up and validate locally
Part 1: CREATE SOME PENDING MEMBERS
NO USER PRESENT
- Run gdk/gitpod server and login
- Choose any group you're an admin of then go to Group > Manage > Members and click "Invite members" in the top right
- Enter a random email address (one that doesn't already exist in the gdk database)
- Be sure to click on the email address then "Invite" in the bottom right
USER PRESENT
- From your terminal, run
gdk rails c
- From the console, locate the group where you chose to add pending members, choose an active member, update their state to awaiting
group = Group.find_by(name: "Flightjs")
member = group.members.first
member.update!(state: ::Member::STATE_AWAITING)
This will create a pending member with a user present. (I'm otherwise not sure how to do this from the UI the organic way - comments welcome!)
Part 2: QUERY IN GRAPHIQL
- Now that you have some pending members, go to
http://127.0.0.1:3000/-/graphql-explorer
and query away! For example:
query {
group(fullPath: "flightjs") {
fullPath
pendingMembers {
nodes {
id
name
username
email
webUrl
invited
avatarUrl
approved
}
}
}
}
Part 3: COMPARE TO THE EXISTING REST API
- Using your favorite tool to call an api (I like postman) query the same group for pending members and verify the data returned is the same:
http://127.0.0.1:3000/api/v4/groups/33/pending_members
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Missy Davies