Address review feedback: Resolve N+1 issues
MR: Address N+1 query issues (!119434 - closed)
Address the following potential N+1 problems with WorkspaceType
and other areas, which were found during review:
-
!105783 (comment 1374842474) - "Performance: This will most likely cause an N+1, so we might want to preload it (in the resolver)."
- https://gitlab.com/gitlab-org/gitlab/-/blob/remote_dev/ee/app/graphql/types/remote_development/workspace_type.rb#L22-22
-
field :user, ::Types::UserType, null: false, description: 'Owner of the workspace.'
-
!105783 (comment 1374844224) - "Performance: I'm not 100% sure but this also might cause an N+1."
- https://gitlab.com/gitlab-org/gitlab/-/blob/remote_dev/ee/app/graphql/types/remote_development/workspace_type.rb#L14-14
-
field :cluster_agent, ::Types::Clusters::AgentType, null: false, method: :agent, description: 'Kubernetes Agent associated with the workspace.'
-
!105783 (comment 1374939446) - "Performance: We need an N+1 spec in this file"
- https://gitlab.com/gitlab-org/gitlab/-/blob/remote_dev/ee/spec/requests/api/graphql/remote_development/workspaces_by_ids_spec.rb#L5-5
-
RSpec.describe 'Query.workspaces(ids: [RemoteDevelopmentWorkspaceID!])', feature_category: :remote_development do
References
Edited by Chad Woolley