[GraphQL]: démarche and dossier number should be a number
This commit is contained in:
parent
f2181b767c
commit
ea6667ff9f
5 changed files with 11 additions and 11 deletions
|
@ -164,7 +164,7 @@ type Demarche {
|
||||||
"""
|
"""
|
||||||
Le numero de la démarche.
|
Le numero de la démarche.
|
||||||
"""
|
"""
|
||||||
number: ID!
|
number: Int!
|
||||||
state: DemarcheState!
|
state: DemarcheState!
|
||||||
title: String!
|
title: String!
|
||||||
updatedAt: ISO8601DateTime!
|
updatedAt: ISO8601DateTime!
|
||||||
|
@ -244,7 +244,7 @@ type Dossier {
|
||||||
"""
|
"""
|
||||||
Le numero du dossier.
|
Le numero du dossier.
|
||||||
"""
|
"""
|
||||||
number: ID!
|
number: Int!
|
||||||
|
|
||||||
"""
|
"""
|
||||||
L'état du dossier.
|
L'état du dossier.
|
||||||
|
@ -507,7 +507,7 @@ type Query {
|
||||||
"""
|
"""
|
||||||
Numéro de la démarche.
|
Numéro de la démarche.
|
||||||
"""
|
"""
|
||||||
number: ID!
|
number: Int!
|
||||||
): Demarche!
|
): Demarche!
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -517,7 +517,7 @@ type Query {
|
||||||
"""
|
"""
|
||||||
Numéro du dossier.
|
Numéro du dossier.
|
||||||
"""
|
"""
|
||||||
number: ID!
|
number: Int!
|
||||||
): Dossier!
|
): Dossier!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Types
|
||||||
description "Une demarche"
|
description "Une demarche"
|
||||||
|
|
||||||
global_id_field :id
|
global_id_field :id
|
||||||
field :number, ID, "Le numero de la démarche.", null: false, method: :id
|
field :number, Int, "Le numero de la démarche.", null: false, method: :id
|
||||||
field :title, String, null: false, method: :libelle
|
field :title, String, null: false, method: :libelle
|
||||||
field :description, String, "Déscription de la démarche.", null: false
|
field :description, String, "Déscription de la démarche.", null: false
|
||||||
field :state, DemarcheState, null: false
|
field :state, DemarcheState, null: false
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Types
|
||||||
description "Un dossier"
|
description "Un dossier"
|
||||||
|
|
||||||
global_id_field :id
|
global_id_field :id
|
||||||
field :number, ID, "Le numero du dossier.", null: false, method: :id
|
field :number, Int, "Le numero du dossier.", null: false, method: :id
|
||||||
field :state, DossierState, "L'état du dossier.", null: false
|
field :state, DossierState, "L'état du dossier.", null: false
|
||||||
field :updated_at, GraphQL::Types::ISO8601DateTime, "Date de dernière mise à jour.", null: false
|
field :updated_at, GraphQL::Types::ISO8601DateTime, "Date de dernière mise à jour.", null: false
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
module Types
|
module Types
|
||||||
class QueryType < Types::BaseObject
|
class QueryType < Types::BaseObject
|
||||||
field :demarche, DemarcheType, null: false, description: "Informations concernant une démarche." do
|
field :demarche, DemarcheType, null: false, description: "Informations concernant une démarche." do
|
||||||
argument :number, ID, "Numéro de la démarche.", required: true
|
argument :number, Int, "Numéro de la démarche.", required: true
|
||||||
end
|
end
|
||||||
|
|
||||||
field :dossier, DossierType, null: false, description: "Informations sur un dossier d'une démarche." do
|
field :dossier, DossierType, null: false, description: "Informations sur un dossier d'une démarche." do
|
||||||
argument :number, ID, "Numéro du dossier.", required: true
|
argument :number, Int, "Numéro du dossier.", required: true
|
||||||
end
|
end
|
||||||
|
|
||||||
def demarche(number:)
|
def demarche(number:)
|
||||||
|
|
|
@ -76,7 +76,7 @@ describe API::V2::GraphqlController do
|
||||||
expect(gql_errors).to eq(nil)
|
expect(gql_errors).to eq(nil)
|
||||||
expect(gql_data).to eq(demarche: {
|
expect(gql_data).to eq(demarche: {
|
||||||
id: procedure.to_typed_id,
|
id: procedure.to_typed_id,
|
||||||
number: procedure.id.to_s,
|
number: procedure.id,
|
||||||
title: procedure.libelle,
|
title: procedure.libelle,
|
||||||
description: procedure.description,
|
description: procedure.description,
|
||||||
state: 'brouillon',
|
state: 'brouillon',
|
||||||
|
@ -123,7 +123,7 @@ describe API::V2::GraphqlController do
|
||||||
expect(gql_errors).to eq(nil)
|
expect(gql_errors).to eq(nil)
|
||||||
expect(gql_data).to eq(demarche: {
|
expect(gql_data).to eq(demarche: {
|
||||||
id: procedure.to_typed_id,
|
id: procedure.to_typed_id,
|
||||||
number: procedure.id.to_s,
|
number: procedure.id,
|
||||||
dossiers: {
|
dossiers: {
|
||||||
nodes: [{ id: dossier1.to_typed_id }, { id: dossier.to_typed_id }]
|
nodes: [{ id: dossier1.to_typed_id }, { id: dossier.to_typed_id }]
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ describe API::V2::GraphqlController do
|
||||||
expect(gql_errors).to eq(nil)
|
expect(gql_errors).to eq(nil)
|
||||||
expect(gql_data).to eq(dossier: {
|
expect(gql_data).to eq(dossier: {
|
||||||
id: dossier.to_typed_id,
|
id: dossier.to_typed_id,
|
||||||
number: dossier.id.to_s,
|
number: dossier.id,
|
||||||
state: 'en_construction',
|
state: 'en_construction',
|
||||||
updatedAt: dossier.updated_at.iso8601,
|
updatedAt: dossier.updated_at.iso8601,
|
||||||
datePassageEnConstruction: dossier.en_construction_at.iso8601,
|
datePassageEnConstruction: dossier.en_construction_at.iso8601,
|
||||||
|
|
Loading…
Reference in a new issue