Class: GraphQL::Query::NullContext

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Singleton
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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNullContext

Returns a new instance of NullContext.



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

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

Instance Attribute Details

#dataloaderObject (readonly)

Returns the value of attribute dataloader.



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

def dataloader
  @dataloader
end

#queryObject (readonly)

Returns the value of attribute query.



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

def query
  @query
end

#schemaObject (readonly)

Returns the value of attribute schema.



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

def schema
  @schema
end

#wardenObject (readonly)

Returns the value of attribute warden.



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

def warden
  @warden
end

Instance Method Details

#interpreter?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/graphql/query/null_context.rb', line 29

def interpreter?
  true
end