Skip to content

Commit

Permalink
chore: add warning to cursor pagination hook
Browse files Browse the repository at this point in the history
  • Loading branch information
psteinroe committed Aug 3, 2023
1 parent 357cded commit fd4c174
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/pages/postgrest/queries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ The hook does not use a count query and therefore does not know how many items t

## `useCursorInfiniteScrollQuery`

<Callout emoji="⚠️">
After using this hook in production, a few subtile issues were discovered.
Please use it with caution. While improving the stability, I might introduce
breaking changes.
</Callout>

Similiar to `useOffsetInfiniteScrollQuery`, but instead of using the `offset` filter to paginate, it uses a cursor. You can find a longer rationale on why this is more performant than offset-based pagination [here](https://the-guild.dev/blog/graphql-cursor-pagination-with-postgresql#).

For the cursor pagination to work, the query _has to have_:
Expand Down

2 comments on commit fd4c174

@vercel
Copy link

@vercel vercel bot commented on fd4c174 Aug 3, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

supabase-cache-helpers-react-query – ./examples/react-query

supabase-cache-helpers-react-query-psteinroe.vercel.app
supabase-cache-helpers-react-query-git-main-psteinroe.vercel.app
supabase-cache-helpers-react-query.vercel.app

@vercel
Copy link

@vercel vercel bot commented on fd4c174 Aug 3, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.