Class: GraphQL::Dataloader::RequestAll

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

Overview

Instance Method Summary collapse

Constructor Details

#initialize(source, keys) ⇒ RequestAll

Returns a new instance of RequestAll.



6
7
8
9
# File 'lib/graphql/dataloader/request_all.rb', line 6

def initialize(source, keys)
  @source = source
  @keys = keys
end

Instance Method Details

#loadArray<Object>

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

Returns:

  • (Array<Object>)

    One object for each of keys



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

def load
  @source.load_all(@keys)
end