-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add helper methods to read Apollo data from store directly #227
Comments
facebook/relay#114 might have some relevant insights here, too |
@stubailo is this still planned? |
@jbaxleyiii Sort of, although the |
I just ran into a use case for this, where I have to access the Apollo data from outside the React component tree. I actually managed to do it with the In other words, I'm trying to replicate the behavior of Meteor's |
FYI I ended up accessing |
There is .watchQuery(...).currentResult() now, which runs synchronously. Would that be better? Curious what the use case is. |
Oh maybe, I'd have to try it out. And the use case is getting a list of categories from the store to populate a |
Done 🎉 |
This probably just means nicely packaging the following:
One question is, where do we get the config from? Since the configuration is currently passed into
new ApolloClient()
, we could do it like:options
would be stuff like whether to return partial results, I guess.Fun fact - with just a little bit of massaging these methods could eventually be modified to let you use GraphQL queries to access your client-side state as well, as long as it fits the correct normalized form!
The text was updated successfully, but these errors were encountered: