This is an example of graphql api that's using mercurius
& graphql-js
that support execution cancelling
graphql-js - Allow execution to be cancelled
mercurius - POC for execution cancelling
Please follow these steps:
- Close mercurius fork repo where execution cancelling is implemented and checkout to the feature branch: https://github.com/igrlk/mercurius/tree/abort-execution
- In
./index.js
, update the mercurius path to point to the cloned fork (e.g.require('../mercurius')
) yarn
yarn start
- Send a request to
http://127.0.0.1:3000/
- After "A resolver was called" appeared in the console, cancel the request
- See the console after the cancellation - it shouldn't run resolvers that are going after the cancelled one