Merge pull request #8713 from tchak/fix-graphql-as_degraded_mode

fix(graphql): fix etablissement as_degraded_mode?
This commit is contained in:
Paul Chavard 2023-02-28 17:50:10 +00:00 committed by GitHub
commit ad98f2508b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,10 @@ module Types::Champs
def etablissement
if object.etablissement_id.present?
Loaders::Record.for(Etablissement).load(object.etablissement_id)
Loaders::Record.for(Etablissement).load(object.etablissement_id).then do |etablissement|
return nil if etablissement.as_degraded_mode?
etablissement
end
end
end
end