File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ export function mutationWithClientMutationId(
88
88
resolve : ( _ , { input } , context , info ) => {
89
89
const { clientMutationId } = input ;
90
90
const payload = mutateAndGetPayload ( input , context , info ) ;
91
- if ( payload instanceof Promise ) {
91
+ if ( isPromiseLike ( payload ) ) {
92
92
return payload . then ( injectClientMutationId ) ;
93
93
}
94
94
return injectClientMutationId ( payload ) ;
@@ -104,3 +104,13 @@ export function mutationWithClientMutationId(
104
104
} ,
105
105
} ;
106
106
}
107
+
108
+ // FIXME: Temporary until graphql-js resolves this issue
109
+ // See, https://github.com/graphql/graphql-js/pull/3243#issuecomment-919510590
110
+ declare function isPromiseLike(value: mixed): boolean %checks(value instanceof
111
+ Promise);
112
+
113
+ // eslint-disable-next-line no-redeclare
114
+ function isPromiseLike(value) {
115
+ return typeof value ?. then === 'function' ;
116
+ }
You can’t perform that action at this time.
0 commit comments