From 78e0fb6cc6b91b5a784d8bf00534bd6f100c477e Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Thu, 16 Nov 2017 20:31:08 +0100 Subject: [PATCH] Add UpdateAssetStatus mutation --- client/coral-framework/graphql/fragments.js | 1 + client/coral-framework/graphql/mutations.js | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/client/coral-framework/graphql/fragments.js b/client/coral-framework/graphql/fragments.js index a99dc0ee2..8b4c19e6f 100644 --- a/client/coral-framework/graphql/fragments.js +++ b/client/coral-framework/graphql/fragments.js @@ -18,6 +18,7 @@ export default { 'StopIgnoringUserResponse', 'UpdateSettingsResponse', 'UpdateAssetSettingsResponse', + 'UpdateAssetStatusResponse', ) }; diff --git a/client/coral-framework/graphql/mutations.js b/client/coral-framework/graphql/mutations.js index 1c43f4707..21bfd1825 100644 --- a/client/coral-framework/graphql/mutations.js +++ b/client/coral-framework/graphql/mutations.js @@ -382,3 +382,22 @@ export const withUpdateAssetSettings = withMutation( }); }}), }); + +export const withUpdateAssetStatus = withMutation( + gql` + mutation UpdateAssetStatus($id: ID!, $input: AssetStatusInput!) { + updateAssetStatus(id: $id, input: $input) { + ...UpdateAssetStatusResponse + } + } + `, { + props: ({mutate}) => ({ + updateAssetStatus: (id, input) => { + return mutate({ + variables: { + id, + input, + }, + }); + }}), + });