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.



25
26
27
28
29
30
31
32
33
34
# File 'lib/graphql/query/null_context.rb', line 25

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.



23
24
25
# File 'lib/graphql/query/null_context.rb', line 23

def dataloader
  @dataloader
end

#queryObject (readonly)

Returns the value of attribute query.



23
24
25
# File 'lib/graphql/query/null_context.rb', line 23

def query
  @query
end

#schemaObject (readonly)

Returns the value of attribute schema.



23
24
25
# File 'lib/graphql/query/null_context.rb', line 23

def schema
  @schema
end

#wardenObject (readonly)

Returns the value of attribute warden.



23
24
25
# File 'lib/graphql/query/null_context.rb', line 23

def warden
  @warden
end

Class Method Details

.[](key) ⇒ Object



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

def [](key); end

.instanceObject



47
48
49
# File 'lib/graphql/query/null_context.rb', line 47

def instance
  @instance ||= self.new
end

Instance Method Details

#[](key) ⇒ Object



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

def [](key); end

#interpreter?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/graphql/query/null_context.rb', line 38

def interpreter?
  true
end