T
tRPC

What would be considered best practice for getting data and invalidating queries?

What would be considered best practice for getting data and invalidating queries?

Zzodiak10/5/2023
I have a really simple task management app (doing it to learn stuff). Tasks are grouped in projects and have tags. I opted to load all projects, including the tasks and the tags on the tasks with a single query. When I add a new task or a tag, what would be the recommended way to update the data? - Invalidate the query to the big procedure and reload everything? - Separate the loading the data into different queries? - There is a way to invalidate only part of the big query? - Something else?
DDavid10/9/2023
In case you are still looking for the answer, you could use optimistic updates. https://tanstack.com/query/v4/docs/react/guides/optimistic-updates

Looking for more? Join the community!

T
tRPC

What would be considered best practice for getting data and invalidating queries?

Join Server