Merge pull request #6228 from tchak/update-export-query

Update dossier serialize query to stop using deprecated fileds
This commit is contained in:
Paul Chavard 2021-05-26 11:26:29 +02:00 committed by GitHub
commit daa20b0b6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 57 additions and 50 deletions

View file

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

View file

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

View file

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

View file

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