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: NullWarden

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNullContext

Returns a new instance of NullContext.



14
15
16
17
18
19
20
21
22
23
# File 'lib/graphql/query/null_context.rb', line 14

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

Instance Attribute Details

#dataloaderObject (readonly)

Returns the value of attribute dataloader.



12
13
14
# File 'lib/graphql/query/null_context.rb', line 12

def dataloader
  @dataloader
end

#queryObject (readonly)

Returns the value of attribute query.



12
13
14
# File 'lib/graphql/query/null_context.rb', line 12

def query
  @query
end

#schemaObject (readonly)

Returns the value of attribute schema.



12
13
14
# File 'lib/graphql/query/null_context.rb', line 12

def schema
  @schema
end

#wardenObject (readonly)

Returns the value of attribute warden.



12
13
14
# File 'lib/graphql/query/null_context.rb', line 12

def warden
  @warden
end

Class Method Details

.[](key) ⇒ Object



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

def [](key); end

.instanceObject



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

def instance
  @instance = self.new
end

Instance Method Details

#[](key) ⇒ Object



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

def [](key); end

#interpreter?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/graphql/query/null_context.rb', line 27

def interpreter?
  false
end