add new fields to serializer

This commit is contained in:
Lisa Durand 2023-03-06 12:44:46 +01:00
parent 0679fdc55f
commit 5b0570d289
3 changed files with 6 additions and 0 deletions

View file

@ -177,6 +177,8 @@ type Avis {
id: ID!
instructeur: Profile! @deprecated(reason: "Utilisez le champ `claimant` à la place.")
question: String!
questionAnswer: Boolean
questionLabel: String
reponse: String
}

View file

@ -4,6 +4,8 @@ module Types
field :question, String, null: false, method: :introduction
field :reponse, String, null: true, method: :answer
field :question_label, String, null: true
field :question_answer, Boolean, null: true
field :date_question, GraphQL::Types::ISO8601DateTime, null: false, method: :created_at
field :date_reponse, GraphQL::Types::ISO8601DateTime, null: true, method: :updated_at

View file

@ -1,6 +1,8 @@
class AvisSerializer < ActiveModel::Serializer
attributes :answer,
:introduction,
:question_label,
:question_answer,
:created_at,
:answered_at