TanStackT
TanStack3y ago
2 replies
uncertain-scarlet

Best practices for defining using persistQueryClient with Next.js

A few parts to to this:
a) Where should you normally define a queryClient, outside of the one used inside the _app.js file's state for initialising the QueryClientProvider
b) Should I use persistQueryClientSave every time I want to perform a mutation on data that will then be persisted in the cache
c) Is it acceptable to have multiple queryClients in a file within the pages directory, particularly when using getStaticProps or getServerSideProps?
Was this page helpful?