UNPKG

graphql-yoga

Version:

<div align="center"><img src="./website/public/cover.png" width="720" /></div>

20 lines (19 loc) 678 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useExecutionCancellation = void 0; /** * Enables experimental support for request cancelation. */ function useExecutionCancellation() { return { onExecute({ args }) { // @ts-expect-error we don't have this typing in envelop args.signal = args.contextValue?.request?.signal ?? undefined; }, onSubscribe({ args }) { // @ts-expect-error we don't have this typing in envelop args.signal = args.contextValue?.request?.signal ?? undefined; }, }; } exports.useExecutionCancellation = useExecutionCancellation;