Update dossier serialize query to stop using deprecated fileds

This commit is contained in:
Paul Chavard 2021-05-25 12:59:11 +02:00
parent a2a66a6d59
commit 18ce027b84
4 changed files with 57 additions and 50 deletions

View file

@ -1139,6 +1139,7 @@ type File {
}
interface GeoArea {
description: String
geometry: GeoJSON!
id: ID!
source: GeoAreaSource!
@ -1471,6 +1472,7 @@ type ParcelleCadastrale implements GeoArea {
codeCom: String! @deprecated(reason: "Utilisez le champ `commune` à la place.")
codeDep: String! @deprecated(reason: "Utilisez le champ `commune` à la place.")
commune: String!
description: String
feuille: Int! @deprecated(reason: "Linformation nest plus disponible.")
geometry: GeoJSON!
id: ID!
@ -1590,7 +1592,7 @@ type Revision {
}
type SelectionUtilisateur implements GeoArea {
description: String!
description: String
geometry: GeoJSON!
id: ID!
source: GeoAreaSource!

View file

@ -13,6 +13,7 @@ module Types
global_id_field :id
field :source, GeoAreaSource, null: false
field :geometry, Types::GeoJSON, null: false, method: :safe_geometry
field :description, String, null: true
definition_methods do
def resolve_type(object, context)

View file

@ -1,7 +1,5 @@
module Types::GeoAreas
class SelectionUtilisateurType < Types::BaseObject
implements Types::GeoAreaType
field :description, String, null: false
end
end

View file

@ -48,7 +48,9 @@ class SerializerService
query serializeChamp($number: Int!, $id: ID!) {
dossier(number: $number) {
champs(id: $id) {
...RootChampFragment
...ChampFragment
...RepetitionChampFragment
...CarteChampFragment
}
}
}
@ -56,7 +58,9 @@ class SerializerService
query serializeAnnotation($number: Int!, $id: ID!) {
dossier(number: $number) {
annotations(id: $id) {
...RootChampFragment
...ChampFragment
...RepetitionChampFragment
...CarteChampFragment
}
}
}
@ -77,29 +81,28 @@ class SerializerService
label
}
champs {
...RootChampFragment
...ChampFragment
...RepetitionChampFragment
...CarteChampFragment
}
annotations {
...RootChampFragment
...ChampFragment
...RepetitionChampFragment
...CarteChampFragment
}
avis {
...AvisFragment
}
demandeur {
... on PersonnePhysique {
civilite
nom
prenom
dateDeNaissance
}
...PersonnePhysiqueFragment
...PersonneMoraleFragment
}
motivation
motivationAttachment {
byteSize
checksum
filename
contentType
...FileFragment
}
revision {
id
}
}
@ -116,10 +119,7 @@ class SerializerService
email
}
attachment {
byteSize
checksum
filename
contentType
...FileFragment
}
}
@ -141,10 +141,7 @@ class SerializerService
}
... on PieceJustificativeChamp {
file {
byteSize
checksum
filename
contentType
...FileFragment
}
}
... on AddressChamp {
@ -154,35 +151,37 @@ class SerializerService
}
}
fragment RootChampFragment on Champ {
...ChampFragment
... on RepetitionChamp {
champs {
...ChampFragment
}
}
... on CarteChamp {
geoAreas {
source
geometry {
type
coordinates
}
... on ParcelleCadastrale {
codeArr
codeCom
codeDep
feuille
nomCom
numero
section
surfaceParcelle
surfaceIntersection
}
fragment RepetitionChampFragment on RepetitionChamp {
champs {
...ChampFragment
}
}
fragment CarteChampFragment on CarteChamp {
geoAreas {
source
description
geometry {
type
coordinates
}
... on ParcelleCadastrale {
prefixe
numero
commune
section
surface
}
}
}
fragment PersonnePhysiqueFragment on PersonnePhysique {
civilite
nom
prenom
dateDeNaissance
}
fragment PersonneMoraleFragment on PersonneMorale {
siret
siegeSocial
@ -229,5 +228,12 @@ class SerializerService
regionName
regionCode
}
fragment FileFragment on File {
filename
checksum
byteSize
contentType
}
GRAPHQL
end