[graphql] Fix service field which can be nil
In `app/models/procedure.rb`, belongs_to service relation is optional. To be consistent, service field in graphql has can be nil.
This commit is contained in:
parent
edf0687e1b
commit
cb7e8d8a6e
2 changed files with 2 additions and 2 deletions
|
@ -18,7 +18,7 @@ Cela évite l’accès récursif aux dossiers."
|
|||
field :date_fermeture, GraphQL::Types::ISO8601DateTime, "Date de la fermeture.", null: true
|
||||
|
||||
field :revision, Types::RevisionType, null: false
|
||||
field :service, Types::ServiceType, null: false
|
||||
field :service, Types::ServiceType, null: true
|
||||
|
||||
def service
|
||||
Loaders::Record.for(Service).load(procedure.service_id)
|
||||
|
|
|
@ -30,7 +30,7 @@ module Types
|
|||
field :date_fermeture, GraphQL::Types::ISO8601DateTime, "Date de la fermeture.", null: true, method: :closed_at
|
||||
|
||||
field :groupe_instructeurs, [Types::GroupeInstructeurType], null: false
|
||||
field :service, Types::ServiceType, null: false
|
||||
field :service, Types::ServiceType, null: true
|
||||
|
||||
field :dossiers, Types::DossierType.connection_type, "Liste de tous les dossiers d’une démarche.", null: false do
|
||||
argument :order, Types::Order, default_value: :asc, required: false, description: "L’ordre des dossiers."
|
||||
|
|
Loading…
Reference in a new issue