Is there a best practice in graphql for having more of a domain driven design around having queries subscribe to each other and either automatically evict themselves or modify their cache to cause a re-render when the other query is evicted or modified?
In the past with our team, we’ve run into issues where it’s extremely hard to track how some data will change over time if we use logic like
refetchQueries which will result in a lot of queries having a huge list of other queries to modify.
We’d like to have each query or set of queries in a domain to be completely isolated so that it can only be changed in one of two ways:
- The React component triggering the query retriggers it via normal functionality
- In some isolated file, we are tracking all of the other changes to the cache / other queries that will make this query update itself
Is there any built-in way to do this or a best practice workaround?