Class: GraphQL::Query::NullContext
- 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
Constant Summary
Constants inherited from Context
Context::RUNTIME_METADATA_KEYS, Context::UNSPECIFIED_FETCH_DEFAULT
Instance Attribute Summary collapse
- 
  
    
      #dataloader  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute dataloader.
 - 
  
    
      #query  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute query.
 - 
  
    
      #schema  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute schema.
 - 
  
    
      #warden  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute warden.
 
Attributes inherited from Context
#errors, #interpreter, #path, #scoped_context, #types, #value
Instance Method Summary collapse
- 
  
    
      #initialize  ⇒ NullContext 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of NullContext.
 
Methods inherited from Context
#[], #[]=, #add_error, #backtrace, #current_path, #delete, #dig, #execution_errors, #fetch, #inspect, #key?, #logger, #namespace, #namespace?, #response_extensions, #scoped, #scoped_merge!, #scoped_set!, #skip, #to_h
Constructor Details
#initialize ⇒ NullContext
Returns a new instance of NullContext.
      23 24 25 26 27 28 29 30  | 
    
      # File 'lib/graphql/query/null_context.rb', line 23 def initialize @query = NullQuery.new @dataloader = GraphQL::Dataloader::NullDataloader.new @schema = NullSchema @warden = Schema::Warden::NullWarden.new(context: self, schema: @schema) @types = @warden.visibility_profile freeze end  | 
  
Instance Attribute Details
#dataloader ⇒ Object (readonly)
Returns the value of attribute dataloader.
      20 21 22  | 
    
      # File 'lib/graphql/query/null_context.rb', line 20 def dataloader @dataloader end  | 
  
#query ⇒ Object (readonly)
Returns the value of attribute query.
      20 21 22  | 
    
      # File 'lib/graphql/query/null_context.rb', line 20 def query @query end  | 
  
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
      20 21 22  | 
    
      # File 'lib/graphql/query/null_context.rb', line 20 def schema @schema end  | 
  
#warden ⇒ Object (readonly)
Returns the value of attribute warden.
      20 21 22  | 
    
      # File 'lib/graphql/query/null_context.rb', line 20 def warden @warden end  |