I'm working on a GraphQL -> SQL parser that includes some joins, so it makes a performance difference whether a certain field is requested. Is there a way to find that out?
I'm learning about object types, so I think it might have something to do with setting a resolver on it. But a resolver works at the level of the field that's being requested independently of other things. Whereas I'm trying to figure out on the top-most Query level which fields have been requested in the GraphQL query. That will shape the SQL query.
public class QueryType : ObjectType<Query>
{
protected override void Configure(IObjectTypeDescriptor<Query> descriptor)
{
descriptor
.Field(f => f.GetACUMonthlySummary(default!, default!, default!, default!, default!, default!))
.Type<ListType<ACUMonthlySummaryType>>();
}
}
I saw related questions for js, but didn't find any examples specifically in C# and HotChocolate, which is what we're using.