Class: GraphQL::Testing::Helpers::ResolutionAssertionContext
- Inherits:
-
Object
- Object
- GraphQL::Testing::Helpers::ResolutionAssertionContext
- Defined in:
- lib/graphql/testing/helpers.rb
Instance Method Summary collapse
-
#initialize(test, type_name:, object:, schema:, context:) ⇒ ResolutionAssertionContext
constructor
A new instance of ResolutionAssertionContext.
-
#run_graphql_field(field_name, arguments: {}) ⇒ Object
Constructor Details
#initialize(test, type_name:, object:, schema:, context:) ⇒ ResolutionAssertionContext
Returns a new instance of ResolutionAssertionContext.
112 113 114 115 116 117 118 |
# File 'lib/graphql/testing/helpers.rb', line 112 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
121 122 123 124 125 126 127 |
# File 'lib/graphql/testing/helpers.rb', line 121 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 |