From c3d0a2197d261ac9784f478ee1fc2321f3420219 Mon Sep 17 00:00:00 2001 From: Philip Nuzhnyi Date: Tue, 14 Feb 2017 13:03:09 +0000 Subject: [PATCH 1/3] add a note regarding reducer for custom redux actions it looks like reducer feature has been broken for some time now. adding a note here - https://github.com/apollographql/apollo-client/issues/1013 --- react-docs/source/cache-updates.md | 1 + 1 file changed, 1 insertion(+) diff --git a/react-docs/source/cache-updates.md b/react-docs/source/cache-updates.md index ce09486bcdc..6a8673e1b81 100644 --- a/react-docs/source/cache-updates.md +++ b/react-docs/source/cache-updates.md @@ -381,6 +381,7 @@ const CommentsPageWithData = graphql(CommentsPageQuery, { As you can see, the `reducer` option can be used to achieve the same goal as `updateQueries`, but it is more flexible and works with any type of action, not just mutations. For example, the query result can be updated based on another query's result, or even a simple redux action. +*Please Note:* It is currently impossible to respond to actions arriving from outside of Apollo (e.g. your custom Redux actions). See [this thread](https://github.com/apollographql/apollo-client/issues/1013) for more information. **When should you use reducer vs. updateQueries vs. refetchQueries?** From 8a7d01504d6aae5a367ec1c1be1bd8eb3bc91686 Mon Sep 17 00:00:00 2001 From: Jonas Helfer Date: Thu, 9 Mar 2017 15:05:17 -0800 Subject: [PATCH 2/3] Nitpick --- react-docs/source/cache-updates.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react-docs/source/cache-updates.md b/react-docs/source/cache-updates.md index 6a8673e1b81..b946e36c351 100644 --- a/react-docs/source/cache-updates.md +++ b/react-docs/source/cache-updates.md @@ -379,9 +379,9 @@ const CommentsPageWithData = graphql(CommentsPageQuery, { })(CommentsPage); ``` -As you can see, the `reducer` option can be used to achieve the same goal as `updateQueries`, but it is more flexible and works with any type of action, not just mutations. For example, the query result can be updated based on another query's result, or even a simple redux action. +As you can see, the `reducer` option can be used to achieve the same goal as `updateQueries`, but it is more flexible and works with any type of Apollo action, not just mutations. For example, the query result can be updated based on another query's result, or even a simple redux action. -*Please Note:* It is currently impossible to respond to actions arriving from outside of Apollo (e.g. your custom Redux actions). See [this thread](https://github.com/apollographql/apollo-client/issues/1013) for more information. +*Note:* It is not currently possible to respond to actions arriving from outside of Apollo (e.g. your custom Redux actions) in a result reducer. See [this thread](https://github.com/apollographql/apollo-client/issues/1013) for more information. **When should you use reducer vs. updateQueries vs. refetchQueries?** From 04cd3c20ab93c56c43f6630bf9a7ea990ce27637 Mon Sep 17 00:00:00 2001 From: Jonas Helfer Date: Thu, 9 Mar 2017 15:08:44 -0800 Subject: [PATCH 3/3] Remove note --- react-docs/source/cache-updates.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/react-docs/source/cache-updates.md b/react-docs/source/cache-updates.md index fc5b253e92e..5c58365af6e 100644 --- a/react-docs/source/cache-updates.md +++ b/react-docs/source/cache-updates.md @@ -377,8 +377,6 @@ const CommentsPageWithData = graphql(CommentsPageQuery, { As you can see, the `reducer` option can be used to achieve the same goal as `updateQueries`, but it is more flexible and works with any type of **apollo** action, not just mutations. For example, the query result can be updated based on another query's result. -**Coming soon:** will be invoked on any redux action, not just apollo specific. - *Note:* It is not currently possible to respond to actions arriving from outside of Apollo (e.g. your custom Redux actions) in a result reducer. See [this thread](https://github.com/apollographql/apollo-client/issues/1013) for more information.