Method: GraphQL::Dataloader::Source#result_key_for

Defined in:
lib/graphql/dataloader/source.rb

#result_key_for(value) ⇒ Object

Implement this method to return a stable identifier if different key objects should load the same data value.

Parameters:

  • value (Object)

    A value passed to .request or .load, for which a value will be loaded

Returns:

  • (Object)

    The key for tracking this pending data



34
35
36
# File 'lib/graphql/dataloader/source.rb', line 34

def result_key_for(value)
  value
end