feat(graphql): expose pays, region and departement options in schema
This commit is contained in:
parent
c04e39a74d
commit
e19af241ca
5 changed files with 42 additions and 6 deletions
|
@ -346,6 +346,24 @@ class API::V2::StoredQuery
|
|||
collapsibleExplanationEnabled
|
||||
collapsibleExplanationText
|
||||
}
|
||||
... on PaysChampDescriptor {
|
||||
options {
|
||||
name
|
||||
code
|
||||
}
|
||||
}
|
||||
... on RegionChampDescriptor {
|
||||
options {
|
||||
name
|
||||
code
|
||||
}
|
||||
}
|
||||
... on DepartementChampDescriptor {
|
||||
options {
|
||||
name
|
||||
code
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fragment AvisFragment on Avis {
|
||||
|
|
|
@ -1094,9 +1094,9 @@ type DepartementChampDescriptor implements ChampDescriptor {
|
|||
label: String!
|
||||
|
||||
"""
|
||||
List des options d’un champ avec selection.
|
||||
List des departements.
|
||||
"""
|
||||
options: [String!] @deprecated(reason: "Utilisez le champ `DropDownListChampDescriptor.options` à la place.")
|
||||
options: [Departement!]
|
||||
|
||||
"""
|
||||
Est-ce que le champ est obligatoire ?
|
||||
|
@ -3025,9 +3025,9 @@ type PaysChampDescriptor implements ChampDescriptor {
|
|||
label: String!
|
||||
|
||||
"""
|
||||
List des options d’un champ avec selection.
|
||||
List des pays.
|
||||
"""
|
||||
options: [String!] @deprecated(reason: "Utilisez le champ `DropDownListChampDescriptor.options` à la place.")
|
||||
options: [Pays!]
|
||||
|
||||
"""
|
||||
Est-ce que le champ est obligatoire ?
|
||||
|
@ -3313,9 +3313,9 @@ type RegionChampDescriptor implements ChampDescriptor {
|
|||
label: String!
|
||||
|
||||
"""
|
||||
List des options d’un champ avec selection.
|
||||
List des regions.
|
||||
"""
|
||||
options: [String!] @deprecated(reason: "Utilisez le champ `DropDownListChampDescriptor.options` à la place.")
|
||||
options: [Region!]
|
||||
|
||||
"""
|
||||
Est-ce que le champ est obligatoire ?
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
module Types::Champs::Descriptor
|
||||
class DepartementChampDescriptorType < Types::BaseObject
|
||||
implements Types::ChampDescriptorType
|
||||
|
||||
field :options, [Types::Champs::DepartementChampType::DepartementType], "List des departements.", null: true
|
||||
|
||||
def options
|
||||
APIGeoService.departements
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
module Types::Champs::Descriptor
|
||||
class PaysChampDescriptorType < Types::BaseObject
|
||||
implements Types::ChampDescriptorType
|
||||
|
||||
field :options, [Types::Champs::PaysChampType::PaysType], "List des pays.", null: true
|
||||
|
||||
def options
|
||||
APIGeoService.countries
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
module Types::Champs::Descriptor
|
||||
class RegionChampDescriptorType < Types::BaseObject
|
||||
implements Types::ChampDescriptorType
|
||||
|
||||
field :options, [Types::Champs::RegionChampType::RegionType], "List des regions.", null: true
|
||||
|
||||
def options
|
||||
APIGeoService.regions
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue