[GraphQL]: démarche and dossier number should be a number

This commit is contained in:
Paul Chavard 2019-11-07 13:24:34 +01:00
parent f2181b767c
commit ea6667ff9f
5 changed files with 11 additions and 11 deletions

View file

@ -164,7 +164,7 @@ type Demarche {
"""
Le numero de la démarche.
"""
number: ID!
number: Int!
state: DemarcheState!
title: String!
updatedAt: ISO8601DateTime!
@ -244,7 +244,7 @@ type Dossier {
"""
Le numero du dossier.
"""
number: ID!
number: Int!
"""
L'état du dossier.
@ -507,7 +507,7 @@ type Query {
"""
Numéro de la démarche.
"""
number: ID!
number: Int!
): Demarche!
"""
@ -517,7 +517,7 @@ type Query {
"""
Numéro du dossier.
"""
number: ID!
number: Int!
): Dossier!
}

View file

@ -9,7 +9,7 @@ module Types
description "Une demarche"
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 :description, String, "Déscription de la démarche.", null: false
field :state, DemarcheState, null: false

View file

@ -9,7 +9,7 @@ module Types
description "Un dossier"
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 :updated_at, GraphQL::Types::ISO8601DateTime, "Date de dernière mise à jour.", null: false

View file

@ -1,11 +1,11 @@
module Types
class QueryType < Types::BaseObject
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
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
def demarche(number:)

View file

@ -76,7 +76,7 @@ describe API::V2::GraphqlController do
expect(gql_errors).to eq(nil)
expect(gql_data).to eq(demarche: {
id: procedure.to_typed_id,
number: procedure.id.to_s,
number: procedure.id,
title: procedure.libelle,
description: procedure.description,
state: 'brouillon',
@ -123,7 +123,7 @@ describe API::V2::GraphqlController do
expect(gql_errors).to eq(nil)
expect(gql_data).to eq(demarche: {
id: procedure.to_typed_id,
number: procedure.id.to_s,
number: procedure.id,
dossiers: {
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_data).to eq(dossier: {
id: dossier.to_typed_id,
number: dossier.id.to_s,
number: dossier.id,
state: 'en_construction',
updatedAt: dossier.updated_at.iso8601,
datePassageEnConstruction: dossier.en_construction_at.iso8601,