Class: GraphQL::Dataloader::RequestAll

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

Overview

See Source#request_all which returns an instance of this.

Instance Method Summary collapse

Methods inherited from Request

#load_with_deprecation_warning

Constructor Details

#initialize(source, keys) ⇒ RequestAll

Returns a new instance of RequestAll.



8
9
10
11
# File 'lib/graphql/dataloader/request_all.rb', line 8

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

Instance Method Details

#load ⇒ 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

:call-seq:

load() -> Array[Object]


21
22
23
# File 'lib/graphql/dataloader/request_all.rb', line 21

def load
  @source.load_all(@keys)
end