Skip to content
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

Add PaginateMode to the paginate api docs #1310

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion site/src/routes/api/graphql-magic/+page.svx
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@ mutation NewItem($input: AddItemInput!) {

`@cache` is used on a query document to customize the cache behavior. This includes informaton like what [cache policy](/guides/caching-data) should be used by the runtime or if you are okay with partial results from the cache. For a full list of cache policies, check out the [caching guide](/guides/caching-data) and for more information on partial responses, see the [section on partial data](/guides/caching-data#partial-data).

### `@paginate(name: String)`
### `@paginate(name: String, mode: PaginateMode)`

A field marked with `@paginate` is updated with calls to the page loaders returned by the pagination function. For more information on pagination check out the [guide](/guides/pagination). If you pass a value for the `name` argument, the underlying list can be updated using the [operation fragments](/api/mutation#lists).

You can overwrite the default pagination behavior on a per-list basis by passing a value to the `mode` argument:
- `Infinite`: new results are added to the existing list.
- `SinglePage`: new results will replace the contents of the existing list.

### `@blocking`

A query marked with `@blocking` will always await the fetch.
Expand Down
Loading