Class: GraphQL::Dataloader::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/dataloader/request.rb

Overview

Direct Known Subclasses

RequestAll

Instance Method Summary collapse

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

#loadObject

Call this method to cause the current Fiber to wait for the results of this request.

Returns:

  • (Object)

    the object loaded for key



14
15
16
# File 'lib/graphql/dataloader/request.rb', line 14

def load
  @source.load(@key)
end