cmeeren / FSharp.HotChocolate

Support for F# types and nullability in HotChocolate
MIT License
7 stars 1 forks source link

Support fields returning IcedTasks' CancellableTask/CancellableValueTask #19

Open cmeeren opened 1 month ago

cmeeren commented 1 month ago

IcedTask has CEs for CancellableTask/CancellableValueTask. These types are just aliases for CancellationToken -> Task<_> and CancellationToken -> ValueTask<_>.

Currently, fields must accept a CancellationToken and apply this, e.g.:

member _.GetStuff(ct) = getStuff () ct

I'd like:

member _.GetStuff() = getStuff ()

Not sure how to accomplish this without having to either take a dependency on IcedTasks, which I don't want (for the main package at least, and ideally I'd prefer a single package), or otherwise use the task CE in this implementation, which defeats the point of the fields being ValueTask in the first place.