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
How to use Polling + Pagination #1121
Comments
@jimmiebtlr I think this is a duplicate of #1087. The short answer is that they weren't intended to be used together. I thought we had a warning at some point, but it seems that's not the case any more, so we should add it back in. |
Are there any current or future plans to support polling + pagination? |
Workaround // Poll interval that works with pagination
useEffect(() => {
const intervalId = setInterval(() => {
const total =
(queryResult.data?.countSessions.edges.length || 0) +
queryResult.variables.first!;
queryResult?.refetch({
...queryResult.variables,
first: total
});
}, 15_000);
return () => clearInterval(intervalId);
// eslint-disable-next-line
}, [
...Object.values(queryResult.variables).flat(),
queryResult.data?.countSessions.pageInfo.endCursor
]); |
Is polling + pagination still unsupported? If so, this still isn't documented. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
How should this work?
It looks like every time the poll hit's, it completely overwrites the other fetch more portion of things. Is there any way to have the primary query just update query instead of overwriting?
The text was updated successfully, but these errors were encountered: