FSharp.Data.GraphQL
FSharp.Data.GraphQL copied to clipboard
Optimization of field resolver expression execution
This is idea to make FSharp.Data.GraphQL faster and allocating less memory on field execution - consider we have following field definition:
Define.Field("firstName", String, fun _ person -> person.FirstName)
At this point (compilation phase), we already know that the first function field (FieldExecutionContext) is not used. Therefore we actually don't need to create it, and we could pass a simple null instead. We know it won't be used anyway. This could give us potential gain on fields resolution as we construct contexts only when needed.