diff --git a/.changeset/dirty-tigers-matter.md b/.changeset/dirty-tigers-matter.md new file mode 100644 index 00000000000..1a5d4a9e195 --- /dev/null +++ b/.changeset/dirty-tigers-matter.md @@ -0,0 +1,13 @@ +--- +"@apollo/client": minor +--- + +Create a new `useQueryRefHandlers` hook that returns `refetch` and `fetchMore` functions for a given `queryRef`. This is useful to get access to handlers for a `queryRef` that was created by `createQueryPreloader` or when the handlers for a `queryRef` produced by a different component are inaccessible. + +```jsx +const MyComponent({ queryRef }) { + const { refetch, fetchMore } = useQueryRefHandlers(queryRef); + + // ... +} +```