Share preloads across multiple GraphQL project resolvers

What does this MR do and why?

Related to #515185 (closed)

In Migrate Your Work > Projects list to Vue and mo... (&13066 - closed) we are migrating Your work -> Projects to Vue with a GraphQL data source. This is currently behind the your_work_projects_vue feature flag which is not yet enabled. For this page we use three different GraphQL queries that hit three different resolvers:

app/graphql/resolvers/projects_resolver.rb already has some preloads setup but since the other resolvers do not extend this resolver they do not benefit from these preloads and have some N+1 issues. This MR creates a look_ahead_preloads.rb concern that can be shared across all the project resolvers so they get the same preloads.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

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.

How to set up and validate locally

  1. Go to http://gdk.test:3000/rails/features and enable the your_work_projects_vue feature flag
  2. Go to http://gdk.test:3000/dashboard/projects
Edited by Peter Hegman

Merge request reports

Loading