'Avoid GraphQL Strawberry Shake overfetching

How avoid Strawberry over fetching? Greetings everyone. I'm trying create a graphql client library using Strawberry Shake. I have a code works fine but when I create a query and generate the code I can see that the c# objects generated creates properties for every query's field and I thinks is great. My problem is when I execute this query I get all fields in the query incurring in overfetching. Anyone know how avoid this overfetching and only get from remote server a specific set of data and not all data specified in query declaration?

//Query declaration in .graphql file
query QueryName($var1: Uuid!, $var2: String!) {
    remoteQueryName(var1: $var1, var2: $var2) {
        field1
        field2
    }
}

When I call the method ExecuteAsync(Guid var1, string var2) of the generated code I fetch from remote schema field1 and field2. Can I take control of what is fetching from remote schema and for example fetch only field1 or only field2 or bouth?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source