Merge pull request #8604 from tchak/graphql-optimize

fix(graphql): fixing couple of n+1
This commit is contained in:
Paul Chavard 2023-02-09 10:44:35 +01:00 committed by GitHub
commit 66e1f39778
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -12,7 +12,7 @@ module Loaders
private
def query(keys)
::Dossier.visible_by_administration.where(id: keys)
::Dossier.visible_by_administration.for_api_v2.where(id: keys)
end
end
end

View file

@ -76,7 +76,7 @@ module Types
end
def groupe_instructeur
Loaders::Record.for(GroupeInstructeur).load(object.groupe_instructeur_id)
Loaders::Record.for(GroupeInstructeur, includes: [:procedure]).load(object.groupe_instructeur_id)
end
def demandeur