Method: GraphQL::Dataloader::Source#load
- Defined in:
- lib/graphql/dataloader/source.rb
#load(value) ⇒ Object
Returns The result from #fetch for key. If key hasn't been loaded yet, the Fiber will yield until it's loaded.
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/graphql/dataloader/source.rb', line 63 def load(value) result_key = result_key_for(value) if @results.key?(result_key) result_for(result_key) else @pending[result_key] ||= normalize_fetch_key(value) sync([result_key]) result_for(result_key) end end |