Combined Queries Best Practice
Still struggling with the best way to set this up. I have queries from multiple different accounts but for the same data, and I want to unify them into a collection.
This seems the simplest, and works:
However it results in a new query each time the source data changes and my devtools is littered with it.
I was thinking something where I make the query key just 'pim','eligibleRoles', and whenever the depending queries update their data, to trigger an invalidation on the dependent collection query. Might result in a lot of re-queries but the collection will dedupe those and if data hasn't changed, nothing will trigger at the collection level.
Any best practices for this type of situation?
This seems the simplest, and works:
However it results in a new query each time the source data changes and my devtools is littered with it.
I was thinking something where I make the query key just 'pim','eligibleRoles', and whenever the depending queries update their data, to trigger an invalidation on the dependent collection query. Might result in a lot of re-queries but the collection will dedupe those and if data hasn't changed, nothing will trigger at the collection level.
Any best practices for this type of situation?