Class: GraphQL::Dataloader::Request
- Inherits:
- 
      Object
      
        - Object
- GraphQL::Dataloader::Request
 
- Defined in:
- lib/graphql/dataloader/request.rb
Overview
Direct Known Subclasses
Instance Method Summary collapse
- 
  
    
      #initialize(source, key)  ⇒ Request 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Request. 
- 
  
    
      #load  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Call this method to cause the current Fiber to wait for the results of this request. 
- 
  
    
      #load_with_deprecation_warning  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Constructor Details
#initialize(source, key) ⇒ Request
Returns a new instance of Request.
| 6 7 8 9 | # File 'lib/graphql/dataloader/request.rb', line 6 def initialize(source, key) @source = source @key = key end | 
Instance Method Details
#load ⇒ Object
Call this method to cause the current Fiber to wait for the results of this request.
| 14 15 16 | # File 'lib/graphql/dataloader/request.rb', line 14 def load @source.load(@key) end | 
#load_with_deprecation_warning ⇒ Object
| 18 19 20 21 | # File 'lib/graphql/dataloader/request.rb', line 18 def load_with_deprecation_warning warn("Returning `.request(...)` from GraphQL::Dataloader is deprecated, use `.load(...)` instead. (See usage of #{@source} with #{@key.inspect}).") load end |