From d628c26693af86124aef4c5d4ec29f29897005a1 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 12 Jun 2017 23:25:58 +0700 Subject: [PATCH] Wrap mutations into framework --- plugin-api/beta/client/hocs/withReaction.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin-api/beta/client/hocs/withReaction.js b/plugin-api/beta/client/hocs/withReaction.js index 67a042081..4512d3ac5 100644 --- a/plugin-api/beta/client/hocs/withReaction.js +++ b/plugin-api/beta/client/hocs/withReaction.js @@ -4,8 +4,9 @@ import uuid from 'uuid/v4'; import {connect} from 'react-redux'; import {bindActionCreators} from 'redux'; import {getDisplayName} from 'coral-framework/helpers/hoc'; -import {compose, gql, graphql} from 'react-apollo'; +import {compose, gql} from 'react-apollo'; import withFragments from 'coral-framework/hocs/withFragments'; +import withMutation from 'coral-framework/hocs/withMutation'; import {showSignInDialog} from 'coral-framework/actions/auth'; import {capitalize} from 'coral-framework/helpers/strings'; import {getMyActionSummary, getTotalActionCount} from 'coral-framework/utils'; @@ -219,7 +220,7 @@ export default (reaction) => (WrappedComponent) => { } } - const withDeleteReaction = graphql( + const withDeleteReaction = withMutation( gql` mutation Delete${Reaction}Action($input: Delete${Reaction}ActionInput!) { delete${Reaction}Action(input: $input) { @@ -259,7 +260,7 @@ export default (reaction) => (WrappedComponent) => { } ); - const withPostReaction = graphql( + const withPostReaction = withMutation( gql` mutation Create${Reaction}Action($input: Create${Reaction}ActionInput!) { create${Reaction}Action(input: $input) {