Skip to content

Commit

Permalink
feat(graphql): add rnf_champ to graphql api
Browse files Browse the repository at this point in the history
  • Loading branch information
E-L-T committed Oct 27, 2023
1 parent 8530126 commit 62b706d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/graphql/api/v2/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def self.resolve_type(type_definition, object, ctx)
Types::Champs::Descriptor::RegionChampDescriptorType,
Types::Champs::Descriptor::RepetitionChampDescriptorType,
Types::Champs::Descriptor::RNAChampDescriptorType,
Types::Champs::Descriptor::RNFChampDescriptorType,
Types::Champs::Descriptor::SiretChampDescriptorType,
Types::Champs::Descriptor::TextareaChampDescriptorType,
Types::Champs::Descriptor::TextChampDescriptorType,
Expand Down
33 changes: 33 additions & 0 deletions app/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3535,6 +3535,34 @@ type RNAChampDescriptor implements ChampDescriptor {
type: TypeDeChamp! @deprecated(reason: "Utilisez le champ `__typename` à la place.")
}

type RNFChampDescriptor implements ChampDescriptor {
"""
Description des champs d’un bloc répétable.
"""
champDescriptors: [ChampDescriptor!] @deprecated(reason: "Utilisez le champ `RepetitionChampDescriptor.champ_descriptors` à la place.")

"""
Description du champ.
"""
description: String
id: ID!

"""
Libellé du champ.
"""
label: String!

"""
Est-ce que le champ est obligatoire ?
"""
required: Boolean!

"""
Type de la valeur du champ.
"""
type: TypeDeChamp! @deprecated(reason: "Utilisez le champ `__typename` à la place.")
}

type Region {
code: String!
name: String!
Expand Down Expand Up @@ -4053,6 +4081,11 @@ enum TypeDeChamp {
"""
rna

"""
RNF
"""
rnf

"""
Numéro Siret
"""
Expand Down
2 changes: 2 additions & 0 deletions app/graphql/types/champ_descriptor_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def resolve_type(object, context)
Types::Champs::Descriptor::PieceJustificativeChampDescriptorType
when TypeDeChamp.type_champs.fetch(:rna)
Types::Champs::Descriptor::RNAChampDescriptorType
when TypeDeChamp.type_champs.fetch(:rnf)
Types::Champs::Descriptor::RNFChampDescriptorType
when TypeDeChamp.type_champs.fetch(:carte)
Types::Champs::Descriptor::CarteChampDescriptorType
when TypeDeChamp.type_champs.fetch(:repetition)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Types::Champs::Descriptor
class RNFChampDescriptorType < Types::BaseObject
implements Types::ChampDescriptorType
end
end

0 comments on commit 62b706d

Please sign in to comment.