`client.request()` does not take a `signal` option as shown in examples
pthorsson opened this issue · comments
graphql-request/examples/request-cancellation.ts
Lines 40 to 59 in 9640d0a
According to the examples for request cancellation we can use the signal option to cancel an active request. This is possible when using the standalone request
function. However the request
function exposed in the instance of the GraphQLClient
does not have that possibility it shows in the example it seems. The first argument of that function is of type RequestDocument | TypedDocumentNode<T>
and not an options object.
Should the client.request()
have this possibility, or is the example perhaps wrong?
Edit: typos
Thanks for the report, either the docs will be updated or this will be turned into a feature request. I'll do the latter if the task is easy, which I suspect it will be.
It is an overloaded function and does accept an options object. Check again, feel free to post into Q&A for help.
graphql-request/src/legacy/classes/GraphQLClient.ts
Lines 118 to 120 in 2ad3e80