Class: GraphQL::Testing::Helpers::ResolutionAssertionContext
- Inherits:
-
Object
- Object
- GraphQL::Testing::Helpers::ResolutionAssertionContext
- Defined in:
- lib/graphql/testing/helpers.rb
Instance Attribute Summary collapse
-
#visibility_profile ⇒ Object
readonly
Returns the value of attribute visibility_profile.
Instance Method Summary collapse
-
#initialize(test, type_name:, object:, schema:, context:, visibility_profile:) ⇒ ResolutionAssertionContext
constructor
A new instance of ResolutionAssertionContext.
- #run_graphql_field(field_name, arguments: {}) ⇒ Object
Constructor Details
#initialize(test, type_name:, object:, schema:, context:, visibility_profile:) ⇒ ResolutionAssertionContext
Returns a new instance of ResolutionAssertionContext.
134 135 136 137 138 139 140 141 |
# File 'lib/graphql/testing/helpers.rb', line 134 def initialize(test, type_name:, object:, schema:, context:, visibility_profile:) @test = test @type_name = type_name @object = object @schema = schema @context = context @visibility_profile = visibility_profile end |
Instance Attribute Details
#visibility_profile ⇒ Object (readonly)
Returns the value of attribute visibility_profile.
143 144 145 |
# File 'lib/graphql/testing/helpers.rb', line 143 def visibility_profile @visibility_profile end |
Instance Method Details
#run_graphql_field(field_name, arguments: {}) ⇒ Object
145 146 147 148 149 150 151 |
# File 'lib/graphql/testing/helpers.rb', line 145 def run_graphql_field(field_name, arguments: {}) if @schema @test.run_graphql_field(@schema, "#{@type_name}.#{field_name}", @object, arguments: arguments, context: @context, visibility_profile: @visibility_profile) else @test.run_graphql_field("#{@type_name}.#{field_name}", @object, arguments: arguments, context: @context, visibility_profile: @visibility_profile) end end |