Multiple / dynamic number of query clients?
Hey all! This is more of "should I" rather than a "how do i"? I have users with different roles in different organizations. I am trying to make a seamless experience where the user can swith orgs and then see all of their data for that org. Since the number of orgs a user has is dynamic (and would come from an "app" level query client, I want to create a query client for each org and then use it when they switch orgs. Any gotchas here I am not thinking of? Right now im managing it all with query keys, and the deeper we go the more complicated it gets.
I was thinking of storing an object that contains a key/value pair of org Ids and then then their respective queryClient, and then providing the query client to my route loaders based on a cookie or something. Thanks in advance for the insight!
0 Replies