From 4f77e0413b059c4af121fc0b8235056d13dd5281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Geonizeli?= Date: Thu, 21 Jul 2022 16:49:40 -0300 Subject: [PATCH] fix question alternative type --- app/graphql/types/question_alternative_type.rb | 10 ++++------ app/graphql/types/question_type.rb | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/graphql/types/question_alternative_type.rb b/app/graphql/types/question_alternative_type.rb index df5d86a..7f59268 100644 --- a/app/graphql/types/question_alternative_type.rb +++ b/app/graphql/types/question_alternative_type.rb @@ -1,12 +1,10 @@ # frozen_string_literal: true module Types - module Questions - class Alternative < Types::BaseObject - graphql_name "QuestionAlternative" + class QuestionAlternativeType < Types::BaseObject + graphql_name "QuestionAlternative" - field :correct, Boolean, null: false - field :text, String, null: true - end + field :correct, Boolean, null: false + field :text, String, null: true end end diff --git a/app/graphql/types/question_type.rb b/app/graphql/types/question_type.rb index 37cf4f2..cde3573 100644 --- a/app/graphql/types/question_type.rb +++ b/app/graphql/types/question_type.rb @@ -9,7 +9,6 @@ module Types global_id_field :id field :user_id, Integer, null: false field :subject_id, Integer - field :alternatives, GraphQL::Types::JSON, null: false field :authorship, String field :authorship_year, String field :body, String @@ -18,6 +17,7 @@ module Types field :intention, String field :references, String field :support, String + field :alternatives, [Types::QuestionAlternativeType], null: false field :bloom_taxonomy, Enums::QuestionBloomTaxonomyEnum field :check_type, Enums::QuestionCheckTypeEnum field :difficulty, Enums::QuestionDifficultyEnum