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(
8888 resolve : ( _ , { input } , context , info ) => {
8989 const { clientMutationId } = input ;
9090 const payload = mutateAndGetPayload ( input , context , info ) ;
91- if ( payload instanceof Promise ) {
91+ if ( isPromiseLike ( payload ) ) {
9292 return payload . then ( injectClientMutationId ) ;
9393 }
9494 return injectClientMutationId ( payload ) ;
@@ -104,3 +104,13 @@ export function mutationWithClientMutationId(
104104 } ,
105105 } ;
106106}
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