Skip to content

docs: add note that pagination helpers are examples and should be adapted by users #12699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

phryneas
Copy link
Member

@phryneas phryneas commented Jun 13, 2025

As an experiment, I've created this PR with GitHub Copilot in the Web UI.

WDYT @jerelmiller ?

@phryneas phryneas requested a review from jerelmiller June 13, 2025 08:53
@phryneas phryneas requested a review from a team as a code owner June 13, 2025 08:53
Copy link

changeset-bot bot commented Jun 13, 2025

⚠️ No Changeset found

Latest commit: aed0ccf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

pkg-pr-new bot commented Jun 13, 2025

npm i https://pkg.pr.new/@apollo/client@12699

commit: aed0ccf

Copy link
Contributor

size-limit report 📦

Path Size
dist/apollo-client.min.cjs 41.34 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (CJS) 50.79 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (production) (CJS) 47.88 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" 36.33 KB (0%)
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client" (production) 33.73 KB (0%)
import { ApolloProvider } from "@apollo/client/react" 1.26 KB (0%)
import { ApolloProvider } from "@apollo/client/react" (production) 1.24 KB (0%)
import { useQuery } from "@apollo/client/react" 10.09 KB (0%)
import { useQuery } from "@apollo/client/react" (production) 9.02 KB (0%)
import { useLazyQuery } from "@apollo/client/react" 9.48 KB (0%)
import { useMutation } from "@apollo/client/react" 3.62 KB (0%)
import { useMutation } from "@apollo/client/react" (production) 2.84 KB (0%)
import { useSubscription } from "@apollo/client/react" 4.42 KB (0%)
import { useSubscription } from "@apollo/client/react" (production) 3.48 KB (0%)
import { useSuspenseQuery } from "@apollo/client/react" 5.89 KB (0%)
import { useSuspenseQuery } from "@apollo/client/react" (production) 4.55 KB (0%)
import { useBackgroundQuery } from "@apollo/client/react" 5.38 KB (0%)
import { useBackgroundQuery } from "@apollo/client/react" (production) 4.04 KB (0%)
import { useLoadableQuery } from "@apollo/client/react" 5.47 KB (0%)
import { useLoadableQuery } from "@apollo/client/react" (production) 4.12 KB (0%)
import { useReadQuery } from "@apollo/client/react" 3.43 KB (0%)
import { useReadQuery } from "@apollo/client/react" (production) 3.37 KB (0%)
import { useFragment } from "@apollo/client/react" 2.36 KB (0%)
import { useFragment } from "@apollo/client/react" (production) 2.31 KB (0%)

@@ -3,6 +3,8 @@ title: Core pagination API
description: Fetching and caching paginated results
---

> **Note:** The pagination helper functions provided by Apollo Client (such as `offsetLimitPagination` and `relayStylePagination`) are mostly examples of how to implement a type policy for paginated fields. In most cases, you will need to copy these helpers into your own codebase and adjust them to your requirements.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> **Note:** The pagination helper functions provided by Apollo Client (such as `offsetLimitPagination` and `relayStylePagination`) are mostly examples of how to implement a type policy for paginated fields. In most cases, you will need to copy these helpers into your own codebase and adjust them to your requirements.
<Note>
The pagination helper functions provided by Apollo Client (such as `offsetLimitPagination` and `relayStylePagination`) may not be suitable for all use cases. If you need further customization, copy the implementation into your own codebase and adjust them to your requirements.
</Note>

Since we export these helpers from the library, I don't really like calling them "examples" since they can be used directly. "Example" makes it seem like you shouldn't use these. I'd rather tell users to customize it when it doesn't suit their needs rather than try to encourage them to copy it right away.

NOTE: This suggestion applies to each code block in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants