So, let’s say I have two components: a NavBar with some accounts related buttons and a body component. I have a query that fetches some user data, and I’d like both components to have access to this data.
If I connect both of them using ‘connect’, the query runs twice. I’d prefer that it run once. I can connect their parent, and use mapStateToProps as I’d do with pure redux, but I can’t make heads or tails out of how I’m supposed to use the ‘apollo’ key in the state object.
How do I get the result of a query run on a parent object out of my state object? Or, if this is totally wrongheaded, is there a clear pattern to follow here?