# GraphQL helpers

# relayStylePaginationResolver

relayStylePaginationResolver(store: Store, options?: {
  applyOnNodes?: ($nodes, args) => Ref[],
  allNodesFn?: ($src) => Ref[],
  cursorFn?: ($node) => string
})

This function can be used to mock a relay-style pagination.

Options

Name Description
applyOnNodes Use this option to apply filtering or sorting on the nodes given the arguments the paginated field receives.
allNodesFn A function that'll be used to get all the nodes used for pagination. By default, it will use the nodes of the field this pagination is attached to. This option is handy when several paginable fields should share the same base nodes.
cursorFn The function that'll be used to compute the cursor of a node. By default, it'll use MockStore internal reference Ref's key as cursor.