From abed842c23b40ff33e90f894f38c9ead08cf1003 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 21 Jul 2017 02:27:59 +0700 Subject: [PATCH 1/2] Quick fix inconsistent state --- .../client/containers/Comment.js | 14 ++++++++++++++ .../client/containers/TabPane.js | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/talk-plugin-featured-comments/client/containers/Comment.js b/plugins/talk-plugin-featured-comments/client/containers/Comment.js index bba764a1d..a5c250d60 100644 --- a/plugins/talk-plugin-featured-comments/client/containers/Comment.js +++ b/plugins/talk-plugin-featured-comments/client/containers/Comment.js @@ -31,6 +31,20 @@ export default withFragments({ name } } + + ## + # Figure out why do we need this. + # Currently without this loading more featured comments + # brings apollo into an inconsistent state. + action_summaries { + __typename + count + current_user { + id + } + } + ## + user { id username diff --git a/plugins/talk-plugin-featured-comments/client/containers/TabPane.js b/plugins/talk-plugin-featured-comments/client/containers/TabPane.js index e9d466061..3a082e732 100644 --- a/plugins/talk-plugin-featured-comments/client/containers/TabPane.js +++ b/plugins/talk-plugin-featured-comments/client/containers/TabPane.js @@ -47,7 +47,7 @@ class TabPaneContainer extends React.Component { } const LOAD_MORE_QUERY = gql` - query CoralEmbedStream_LoadMoreComments($limit: Int = 5, $cursor: Date, $asset_id: ID, $sort: SORT_ORDER, $excludeIgnored: Boolean) { + query TalkFeaturedComments_LoadMoreComments($limit: Int = 5, $cursor: Date, $asset_id: ID, $sort: SORT_ORDER, $excludeIgnored: Boolean) { comments(query: {limit: $limit, cursor: $cursor, tags: ["FEATURED"], asset_id: $asset_id, sort: $sort, excludeIgnored: $excludeIgnored}) { nodes { ...${getDefinitionName(Comment.fragments.comment)} From 7ca7166c7a18e16013a819b2515a82e980f9caf7 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 21 Jul 2017 04:08:43 +0700 Subject: [PATCH 2/2] Add clarification --- .../talk-plugin-featured-comments/client/containers/Comment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/talk-plugin-featured-comments/client/containers/Comment.js b/plugins/talk-plugin-featured-comments/client/containers/Comment.js index a5c250d60..2b3de19b5 100644 --- a/plugins/talk-plugin-featured-comments/client/containers/Comment.js +++ b/plugins/talk-plugin-featured-comments/client/containers/Comment.js @@ -33,7 +33,7 @@ export default withFragments({ } ## - # Figure out why do we need this. + # TODO: Remove this when we have the IntrospectionFragmentMatcher. # Currently without this loading more featured comments # brings apollo into an inconsistent state. action_summaries {