graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

Return class of generated result from query is missing properties

Open Cheesebaron opened this issue 5 months ago • 0 comments

Product

Strawberry Shake

Version

14.0.0-p.35

Link to minimal reproduction

https://github.com/Cheesebaron/StrawberryShakeGraphqlIssue

Steps to reproduce

I have a query like (doesn't matter if I use a fragment or not):

query ReportVirtualRange($nodeId: ID!) {
  node(id: $nodeId) {
    id
    __typename
    ... VirtualRangeActivity
  }
}

fragment VirtualRangeActivity on VirtualRangeSessionActivity {
  kind
  time
  strokeCount
}

The generated code for the return value ends up only exposing id and __typename but none of the fields from the fragment. I can do manual typecasting of the Node property to the generated interface, but this is not necessary on most of the the other queries and their generated code.

So when running:

var result = await client.ReportVirtualRange.ExecuteAsync("1234");

What I get in result.Data is just a Node property with id and __typename. The other fields kind, time and strokeCount are not there. image

When I typecast Node to IReportVirtualRange_Node_VirtualRangeSessionActivity: image

What is expected?

I would expect Data already have a type where I can drill into properties. For instance I have another query, which allows me to do:

var activitiesResult = await client.ActivityList.ExecuteAsync();
activitiesResult.Data?.Me?.Activities?.Items

No Node property.

What is actually happening?

Not all properties are generated

Relevant log output

No response

Additional context

No response

Cheesebaron avatar Feb 16 '24 13:02 Cheesebaron