Class: GraphQL::Testing::Helpers::ResolutionAssertionContext

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/testing/helpers.rb

Instance Method Summary collapse

Constructor Details

#initialize(test, type_name:, object:, schema:, context:) ⇒ ResolutionAssertionContext

Returns a new instance of ResolutionAssertionContext.



90
91
92
93
94
95
96
# File 'lib/graphql/testing/helpers.rb', line 90

def initialize(test, type_name:, object:, schema:, context:)
  @test = test
  @type_name = type_name
  @object = object
  @schema = schema
  @context = context
end

Instance Method Details

#run_graphql_field(field_name, arguments: {}) ⇒ Object



99
100
101
102
103
104
105
# File 'lib/graphql/testing/helpers.rb', line 99

def run_graphql_field(field_name, arguments: {})
  if @schema
    @test.run_graphql_field(@schema, "#{@type_name}.#{field_name}", @object, arguments: arguments, context: @context)
  else
    @test.run_graphql_field("#{@type_name}.#{field_name}", @object, arguments: arguments, context: @context)
  end
end