diff --git a/packages/react-relay/relay-hooks/usePrefetchableForwardPaginationFragment_EXPERIMENTAL.js b/packages/react-relay/relay-hooks/usePrefetchableForwardPaginationFragment_EXPERIMENTAL.js index f9e7e4d7dadd5..ace871bbce617 100644 --- a/packages/react-relay/relay-hooks/usePrefetchableForwardPaginationFragment_EXPERIMENTAL.js +++ b/packages/react-relay/relay-hooks/usePrefetchableForwardPaginationFragment_EXPERIMENTAL.js @@ -69,8 +69,11 @@ type LoadMoreOptions = { onComplete?: (Error | null) => void, }; -export type GetExtraVariablesFn = ({ +export type GetExtraVariablesFn = ({ hasNext: boolean, + data: [+key: TKey] extends [+key: {+$fragmentSpreads: mixed, ...}] + ? TData + : ?TData, getServerEdges: () => TEdgeData, }) => Partial; @@ -93,7 +96,7 @@ hook usePrefetchableForwardPaginationFragment_EXPERIMENTAL< prefetchingLoadMoreOptions?: { UNSTABLE_extraVariables?: | Partial - | GetExtraVariablesFn, + | GetExtraVariablesFn, onComplete?: (Error | null) => void, }, minimalFetchSize: number = 1, @@ -290,6 +293,8 @@ hook usePrefetchableForwardPaginationFragment_EXPERIMENTAL< ? // $FlowFixMe[incompatible-call] prefetchingUNSTABLE_extraVariables({ hasNext, + // $FlowFixMe[incompatible-call] + data: fragmentData, getServerEdges: () => { const selector = getSelector(edgesFragment, edgeKeys); const result = [];