Reuse existing projects & groups resolvers for Organization
What does this MR do and why?
Here we have changed the base class of Organizations::GroupsResolver and Organizations::ProjectsResolver from BaseResolver to GroupsResolver and ProjectsResolver respectively to use the existing functionalities of both the resolvers.
We also need a search
argument in the Organizations::ProjectsResolver
and changing its base class added this argument as well.
The GroupsResolver
was missing the sort argument which has been added
as well.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Query plans
Queries haven't changed as I have just moved the sorting from the resolver to the finder and used existing methods for sorting. These plans are just for reference:
- Before - https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/26481/commands/83001
- After - https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/26481/commands/83006
How to set up and validate locally
Run the following GraphQL query on https://gdk.test:3000/-/graphql-explorer:
{
organization(id: "gid://gitlab/Organizations::Organization/1") {
id
projects(sort: "id_desc", search: "Random") {
nodes {
id
path
}
}
}
}
Do the same for groups.
Related to #440943 (closed) #437681 (closed)