Method: GraphQL::Dataloader#yield

Defined in:
lib/graphql/dataloader.rb

#yield(source = ) ⇒ void

This method returns an undefined value.

Tell the dataloader that this fiber is waiting for data.

Dataloader will resume the fiber after the requested data has been loaded (by another Fiber).



135
136
137
138
139
140
141
# File 'lib/graphql/dataloader.rb', line 135

def yield(source = Fiber[:__graphql_current_dataloader_source])
  trace = Fiber[:__graphql_current_multiplex]&.current_trace
  trace&.dataloader_fiber_yield(source)
  Fiber.yield
  trace&.dataloader_fiber_resume(source)
  nil
end