Class: Rspec::GraphQLTypes::TestQuery

Inherits:
GraphQL::Query::NullContext::NullQuery
  • Object
show all
Defined in:
lib/rspec/graphql_types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context:, schema:) ⇒ TestQuery

Returns a new instance of TestQuery.



14
15
16
17
18
19
# File 'lib/rspec/graphql_types.rb', line 14

def initialize(context:, schema:)
  super()
  @context = context
  @schema = schema
  @multiplex = false
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



12
13
14
# File 'lib/rspec/graphql_types.rb', line 12

def context
  @context
end

#multiplexObject (readonly)

Returns the value of attribute multiplex.



12
13
14
# File 'lib/rspec/graphql_types.rb', line 12

def multiplex
  @multiplex
end

#schemaObject (readonly)

Returns the value of attribute schema.



12
13
14
# File 'lib/rspec/graphql_types.rb', line 12

def schema
  @schema
end

Instance Method Details

#handle_or_reraise(err) ⇒ Object



25
26
27
# File 'lib/rspec/graphql_types.rb', line 25

def handle_or_reraise(err)
  schema.handle_or_reraise(context, err)
end

#trace(_key, _data) ⇒ Object



21
22
23
# File 'lib/rspec/graphql_types.rb', line 21

def trace(_key, _data)
  yield
end

#wardenObject



29
30
31
32
33
34
35
# File 'lib/rspec/graphql_types.rb', line 29

def warden
  @warden ||= ::GraphQL::Query::NullContext::NullWarden.new(
    ::GraphQL::Filter.new,
    context: context,
    schema: schema
  )
end