Skip to content
This repository was archived by the owner on Nov 20, 2020. It is now read-only.

Commit 3eb5c58

Browse files
committedMay 25, 2020
feat: adds error policy to useMutation
1 parent 01f9a84 commit 3eb5c58

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/ApolloHooksMutation.re

+6
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ type options('a) = {
6464
[@bs.optional]
6565
optimisticResponse: Js.Json.t,
6666
[@bs.optional]
67+
errorPolicy: string,
68+
[@bs.optional]
6769
context: Context.t,
6870
};
6971

@@ -97,6 +99,7 @@ let useMutation:
9799
unit
98100
=?,
99101
~optimisticResponse: Js.Json.t=?,
102+
~errorPolicy: ApolloHooksTypes.errorPolicy=?,
100103
~context: Context.t=?,
101104
ApolloHooksTypes.graphqlDefinition('data, _, _)
102105
) =>
@@ -112,6 +115,7 @@ let useMutation:
112115
~awaitRefetchQueries=?,
113116
~update=?,
114117
~optimisticResponse=?,
118+
~errorPolicy=?,
115119
~context=?,
116120
(parse, query, _),
117121
) => {
@@ -125,6 +129,8 @@ let useMutation:
125129
~awaitRefetchQueries?,
126130
~update?,
127131
~optimisticResponse?,
132+
~errorPolicy=?
133+
errorPolicy->Belt.Option.map(ApolloHooksTypes.errorPolicyToJs),
128134
~context?,
129135
(),
130136
),

0 commit comments

Comments
 (0)
This repository has been archived.