use axis instead os subjects on new assessement page
This commit is contained in:
13
app/graphql/resolvers/axes_query_resolver.rb
Normal file
13
app/graphql/resolvers/axes_query_resolver.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
module Resolvers
|
||||
class AxesQueryResolver
|
||||
def initialize(context)
|
||||
@context = context
|
||||
end
|
||||
|
||||
def resolve
|
||||
AxisPolicy::Scope.new(@context[:current_user], Axis).resolve
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,6 +6,7 @@ module Types
|
||||
field :questions, QuestionType.connection_type, null: false do
|
||||
argument :where, Inputs::QuestionWhereInput, required: false
|
||||
end
|
||||
field :axes, AxisType.connection_type, null: false
|
||||
field :subjects, SubjectType.connection_type, null: false
|
||||
field :categories, CategoryType.connection_type, null: false
|
||||
field :reviewers, UserType.connection_type, null: false
|
||||
@@ -16,6 +17,10 @@ module Types
|
||||
Resolvers::QuestionsQueryResolver.new(Question, context: context, where: where).resolve
|
||||
end
|
||||
|
||||
def axes
|
||||
Resolvers::AxesQueryResolver.new(context).resolve
|
||||
end
|
||||
|
||||
def subjects
|
||||
Resolvers::SubjectsQueryResolver.new(context).resolve
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user