Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1# With Graphcache's Pagination 2 3<p> 4 <a 5 href="https://stackblitz.com/github/urql-graphql/urql/tree/main/examples/with-graphcache-pagination"> 6 <img 7 alt="Open in StackBlitz" 8 src="https://img.shields.io/badge/open_in_stackblitz-1269D3?logo=stackblitz&style=for-the-badge" 9 /> 10 </a> 11 <a 12 href="https://codesandbox.io/p/sandbox/github/urql-graphql/urql/tree/main/examples/with-graphcache-pagination"> 13 <img 14 alt="Open in CodeSandbox" 15 src="https://img.shields.io/badge/open_in_codesandbox-151515?logo=codesandbox&style=for-the-badge" 16 /> 17 </a> 18</p> 19 20This example shows `urql` in use with `@urql/exchange-graphcache`'s infinite pagination helpers to 21merge several pages of a Relay-compliant schema into an infinite list. 22This largely follows the ["Pagination" section on the "Local Resolvers" docs 23page](https://formidable.com/open-source/urql/docs/graphcache/local-resolvers/#pagination) 24and uses the [`trygql.formidable.dev/graphql/relay-npm` schema](https://github.com/FormidableLabs/trygql). 25 26To run this example install dependencies and run the `start` script: 27 28```sh 29yarn install 30yarn run start 31# or 32npm install 33npm run start 34``` 35 36This example contains: 37 38- The `urql` bindings and a React app with a client set up in [`src/App.js`](src/App.js) 39- The `cacheExchange` from `@urql/exchange-graphcache` in [`src/App.js`](src/App.js) 40- A paginated query for packages in [`src/pages/PaginatedNpmSearch.js`](src/pages/PaginatedNpmSearch.js)