From 5b0570d28991c0db1f8e27112535a730b058cfd9 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Mon, 6 Mar 2023 12:44:46 +0100 Subject: [PATCH] add new fields to serializer --- app/graphql/schema.graphql | 2 ++ app/graphql/types/avis_type.rb | 2 ++ app/serializers/avis_serializer.rb | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index 98f462410..8c39554cc 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -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 } diff --git a/app/graphql/types/avis_type.rb b/app/graphql/types/avis_type.rb index b2620374d..1aff2f908 100644 --- a/app/graphql/types/avis_type.rb +++ b/app/graphql/types/avis_type.rb @@ -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 diff --git a/app/serializers/avis_serializer.rb b/app/serializers/avis_serializer.rb index 0b40903e3..a1212c0a7 100644 --- a/app/serializers/avis_serializer.rb +++ b/app/serializers/avis_serializer.rb @@ -1,6 +1,8 @@ class AvisSerializer < ActiveModel::Serializer attributes :answer, :introduction, + :question_label, + :question_answer, :created_at, :answered_at