Class: GraphQL::Query::NullContext

Inherits:
Object
  • Object
show all
Extended by:
Delegate
Defined in:
lib/graphql/query/null_context.rb

Overview

This object can be ctx in places where there is no query

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Delegate

def_delegators

Constructor Details

#initializeNullContext

Returns a new instance of NullContext.



8
9
10
11
12
13
14
15
16
# File 'lib/graphql/query/null_context.rb', line 8

def initialize
  @query = nil
  @schema = GraphQL::Schema.new
  @warden = GraphQL::Schema::Warden.new(
    GraphQL::Filter.new,
    context: self,
    schema: @schema,
  )
end

Instance Attribute Details

#queryObject (readonly)

Returns the value of attribute query.



6
7
8
# File 'lib/graphql/query/null_context.rb', line 6

def query
  @query
end

#schemaObject (readonly)

Returns the value of attribute schema.



6
7
8
# File 'lib/graphql/query/null_context.rb', line 6

def schema
  @schema
end

#wardenObject (readonly)

Returns the value of attribute warden.



6
7
8
# File 'lib/graphql/query/null_context.rb', line 6

def warden
  @warden
end

Class Method Details

.instanceObject



21
22
23
# File 'lib/graphql/query/null_context.rb', line 21

def instance
  @instance = self.new
end