Currently there is no way to way to provide a CancellationToken instance to the async operation of invoking a query/mutation operation.
Since the generated client is backed by a regular .Net HttpClient then an optional CancellationToken should be accepted and forwarded to the request issued by the underlying client.
The general pattern is to declare a cancellationToken parameter on the method and set it to default so invoking a query could look something like this:
var httpClient = new HttpClient();
httpClient.BaseAddress = new Uri("http://localhost:10000/graphql");
var client = new TestServerGraphQLClient(httpClient);
using CancellationTokenSource cts = new();
var response = await client.Query(static o => o.Me(o => new { o.Id, o.FirstName, o.LastName }), cts.Token);
Currently there is no way to way to provide a
CancellationToken
instance to the async operation of invoking a query/mutation operation.Since the generated client is backed by a regular .Net
HttpClient
then an optionalCancellationToken
should be accepted and forwarded to the request issued by the underlying client.The general pattern is to declare a cancellationToken parameter on the method and set it to
default
so invoking a query could look something like this: