Open phmatray opened 11 months ago
I'm running into this too with a HotChocolate backend. Is there a working example of union types being queried with strawberry shake somewhere? I can adjust the schema as a workaround.
This seems similar to my situation, but in my case it involves an interface. It tries to convert from an IReadOnlyList of the interface name to an IReadOnlyList of the implementation. This happens for just one property that contains an implementation of this interface, weirdly.
Is there an existing issue for this?
Product
Strawberry Shake
Describe the bug
I encountered a build error when generating code for the following GraphQL query:
The error message is as follows:
It appears that the generated code is trying to convert a list of
StrawberryShake.EntityIdOrData?
to a list ofAspireStrapi.BlazorBlog.ApiClient.IGetArticlesPageBlocks_Articles_Data_Attributes_Blocks?
, which is causing the build error.Upon reviewing the code, I believe the type
AspireStrapi.BlazorBlog.ApiClient.IGetArticlesPageBlocks_Articles_Data_Attributes_Blocks
should beIGenericMorphData
instead. This change would align with the structure of the GraphQL query, whereblocks
is a polymorphic type represented by__typename
.This issue seems to be related to an existing open issue: https://github.com/ChilliCream/graphql-platform/issues/4662
Environment:
Steps to Reproduce:
Expected Result: The code should build successfully without any type conversion errors.
Actual Result: The build fails with a CS1503 error due to an incompatible type conversion.
Additional Information: The error seems to be originating from the generated
BlogClient.Client.cs
file.Steps to reproduce
Relevant log output
Additional Context?
Strapi, being an open-source CMS, provides a flexible and customizable platform for developers to manage content and distribute it across multiple platforms. It's written in JavaScript and supports both REST and GraphQL APIs, making it versatile and easy to integrate with various front-end technologies.
It seems It could be a perfect fit with Blazor and Strawberry.
Version
13.7.0 and 14.0.0-p.15