Class: GraphQL::Query::NullContext

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

Overview

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

Defined Under Namespace

Classes: NullQuery, NullSchema, NullWarden

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNullContext

Returns a new instance of NullContext.



22
23
24
25
26
27
28
29
30
31
# File 'lib/graphql/query/null_context.rb', line 22

def initialize
  @query = NullQuery.new
  @dataloader = GraphQL::Dataloader::NullDataloader.new
  @schema = NullSchema
  @warden = NullWarden.new(
    GraphQL::Filter.new,
    context: self,
    schema: @schema,
  )
end

Instance Attribute Details

#dataloaderObject (readonly)

Returns the value of attribute dataloader.



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

def dataloader
  @dataloader
end

#queryObject (readonly)

Returns the value of attribute query.



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

def query
  @query
end

#schemaObject (readonly)

Returns the value of attribute schema.



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

def schema
  @schema
end

#wardenObject (readonly)

Returns the value of attribute warden.



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

def warden
  @warden
end

Class Method Details

.[](key) ⇒ Object



42
# File 'lib/graphql/query/null_context.rb', line 42

def [](key); end

.instanceObject



44
45
46
# File 'lib/graphql/query/null_context.rb', line 44

def instance
  @instance ||= self.new
end

Instance Method Details

#[](key) ⇒ Object



33
# File 'lib/graphql/query/null_context.rb', line 33

def [](key); end

#interpreter?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/graphql/query/null_context.rb', line 35

def interpreter?
  true
end