From e98432b17eed2282225e970fa5a287daee798b7d Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 30 Aug 2017 15:35:52 -0300 Subject: [PATCH 1/3] Exclude Ignored --- .../talk-plugin-featured-comments/client/containers/TabPane.js | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/talk-plugin-featured-comments/client/containers/TabPane.js b/plugins/talk-plugin-featured-comments/client/containers/TabPane.js index d66a0fd49..e0279d9c8 100644 --- a/plugins/talk-plugin-featured-comments/client/containers/TabPane.js +++ b/plugins/talk-plugin-featured-comments/client/containers/TabPane.js @@ -102,6 +102,7 @@ const enhance = compose( tags: ["FEATURED"] sortOrder: $sortOrder sortBy: $sortBy + excludeIgnored: true } deep: true ) @skip(if: $hasComment) { From cb7e7eae97784daae4283e932e2fb36d425cbb2a Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 30 Aug 2017 15:45:25 -0300 Subject: [PATCH 2/3] Using a variable --- .../talk-plugin-featured-comments/client/containers/TabPane.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/talk-plugin-featured-comments/client/containers/TabPane.js b/plugins/talk-plugin-featured-comments/client/containers/TabPane.js index e0279d9c8..93ef402a9 100644 --- a/plugins/talk-plugin-featured-comments/client/containers/TabPane.js +++ b/plugins/talk-plugin-featured-comments/client/containers/TabPane.js @@ -102,7 +102,7 @@ const enhance = compose( tags: ["FEATURED"] sortOrder: $sortOrder sortBy: $sortBy - excludeIgnored: true + excludeIgnored: $excludeIgnored } deep: true ) @skip(if: $hasComment) { From e5c385ae21fbacb0449ae8030864c7bffaa8bb1a Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Thu, 31 Aug 2017 02:05:00 +0700 Subject: [PATCH 3/3] Use correct event name in queries --- client/coral-framework/hocs/withQuery.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/coral-framework/hocs/withQuery.js b/client/coral-framework/hocs/withQuery.js index 101dc45a9..9548827ac 100644 --- a/client/coral-framework/hocs/withQuery.js +++ b/client/coral-framework/hocs/withQuery.js @@ -69,7 +69,7 @@ export default (document, config = {}) => hoistStatics((WrappedComponent) => { const status = networkStatusToString(networkStatus); const {root} = separateDataAndRoot(data); - this.context.eventEmitter.emit(`query.${name}.${status}`, {variables, data: root}); + this.context.eventEmitter.emit(`query.${this.name}.${status}`, {variables, data: root}); } nextData(data) { @@ -121,7 +121,7 @@ export default (document, config = {}) => hoistStatics((WrappedComponent) => { const resolvedDocument = this.resolveDocument(lmArgs.query); const fetchName = getDefinitionName(resolvedDocument); this.context.eventEmitter.emit( - `query.${name}.fetchMore.${fetchName}.begin`, + `query.${this.name}.fetchMore.${fetchName}.begin`, {variables: lmArgs.variables}); // Resolve document fragments before passing it to `apollo-client`. @@ -131,13 +131,13 @@ export default (document, config = {}) => hoistStatics((WrappedComponent) => { }) .then((res) => { this.context.eventEmitter.emit( - `query.${name}.fetchMore.${fetchName}.success`, + `query.${this.name}.fetchMore.${fetchName}.success`, {variables: lmArgs.variables, data: res.data}); return Promise.resolve(res); }) .catch((err) => { this.context.eventEmitter.emit( - `query.${name}.fetchMore.${fetchName}.error`, + `query.${this.name}.fetchMore.${fetchName}.error`, {variables: lmArgs.variables, error: err}); throw err; }); @@ -168,7 +168,7 @@ export default (document, config = {}) => hoistStatics((WrappedComponent) => { const base = (typeof this.wrappedConfig.options === 'function') ? this.wrappedConfig.options(data) : this.wrappedConfig.options; - const configs = this.graphqlRegistry.getQueryOptions(name); + const configs = this.graphqlRegistry.getQueryOptions(this.name); const reducerCallbacks = [base.reducer || ((i) => i)] .concat(...configs.map((cfg) => cfg.reducer))