-
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
reducer option ignored by query and watchQuery #1218
Comments
@daniel-nagy could you use |
Could this be a duplicate of #1129? |
Btw, |
Closing this issue. We don’t recommend using |
@calebmer according to http://dev.apollodata.com/react/cache-updates.html#resultReducers
To me that sounds like https://github.com/apollographql/react-docs/blame/master/source/cache-updates.md#L291 |
@m14t yeah, |
Thanks for the speedy reply @helfer. I'm actually quite new to Apollo and so re-writing that paragraph which does not currently reference |
Haha, no worries, I hope you're liking it so far! I'll update the docs as soon as I get around to it. |
Both
ApolloClient::query
andApolloClient::watchQuery
listreducer
as an option. Thequery
method seems to ignore the option andwatchQuery
only calls the reducer if you create a subscription as well. I'm not sure if this is intended but it wasn't what I expected.version:
0.8.3
framework: React Native
Intended outcome
If I provide
reducer
as an option toquery
orwatchQuery
I would expect it to be invoked every time a query returns a new result.Actual outcome
My
reducer
is ignored unless I also add a subscription on the observable returned fromwatchQuery
.Reproduction
Create a query with
ApolloClient::query
and provide areducer
as an option.The text was updated successfully, but these errors were encountered: