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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of ResolutionAssertionContext.



120
121
122
123
124
125
126
127
# File 'lib/graphql/testing/helpers.rb', line 120

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_profileObject (readonly)

Returns the value of attribute visibility_profile.



129
130
131
# File 'lib/graphql/testing/helpers.rb', line 129

def visibility_profile
  @visibility_profile
end

Instance Method Details

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



131
132
133
134
135
136
137
# File 'lib/graphql/testing/helpers.rb', line 131

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