Skip to content

updateQuery is ignored when page variable is reactive #1299

Answered by Akryum
terion-name asked this question in Q&A
Discussion options

You must be logged in to vote

Using page in your reactive variables will re-fetch and update the whole query with the new page value. The correct way is only putting the initial page value in the query variables. See the docs.

You can further optimize the cache with keyArgs in your type policies so that coming back to this component will render everything already loaded (even beyond the 1st page):

keyArgs: ['locale', 'category'] // exclude the page from the cache key

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@terion-name
Comment options

Answer selected by Akryum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1298 on December 06, 2021 14:18.