fix question query load
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
module Types
|
||||
class BaseConnection < Types::BaseObject
|
||||
# add `nodes` and `pageInfo` fields, as well as `edge_type(...)` and `node_nullable(...)` overrides
|
||||
include GraphQL::Types::Relay::ConnectionBehaviors
|
||||
|
||||
edges_nullable(false)
|
||||
edge_nullable(false)
|
||||
node_nullable(false)
|
||||
|
||||
field :total_count, Integer, null: false
|
||||
|
||||
def total_count
|
||||
object.items.count
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,8 +7,6 @@ module Types
|
||||
graphql_name 'Question'
|
||||
|
||||
global_id_field :id
|
||||
field :user_id, Integer, null: false
|
||||
field :subject_id, Integer
|
||||
field :authorship, String
|
||||
field :authorship_year, String
|
||||
field :body, String
|
||||
@@ -17,6 +15,10 @@ module Types
|
||||
field :intention, String
|
||||
field :references, String
|
||||
field :support, String
|
||||
field :user, Types::UserType, null: false
|
||||
field :subject, Types::SubjectType
|
||||
field :reviewer, Types::UserType
|
||||
field :review_messages, Types::ReviewMessageType.connection_type, null: false
|
||||
field :alternatives, [Types::QuestionAlternativeType], null: false
|
||||
field :bloom_taxonomy, Enums::QuestionBloomTaxonomyEnum
|
||||
field :check_type, Enums::QuestionCheckTypeEnum
|
||||
@@ -24,5 +26,9 @@ module Types
|
||||
field :status, Enums::QuestionStatusEnum, null: false
|
||||
field :created_at, GraphQL::Types::ISO8601DateTime, null: false
|
||||
field :updated_at, GraphQL::Types::ISO8601DateTime, null: false
|
||||
|
||||
def self.model
|
||||
Question
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user