Closed richardaubin closed 7 months ago
Thanks for reporting. I'll hope to find some time during this week to fix these.
No problem. The first group of errors are related to the Enum generation. The enums with errors are of the 0000x0000 type. When the enums are generated, the is removed and produces an invalid enum name starting with integers. The _ should be kept when the name is created.
And not sure how to explain the other ones :)
It's at least three issues:
EnumValueNaming = EnumValueNamingOption.Original
optionIncludeDeprecatedFields = true
The metadata contains some invalid information. For example GraphQL doesn't support interface inheritance but in your schema there are 57 interfaces defined as inheriting from other interface. This is part of the third issue, the easier.
Another thing is that a type implements multiple interfaces with same member name but different type (interface). Without containing that definition on the object type. I know that GraphQL allows this (by dynamic object building from the interface if not defined). Will have to extend the generator to support that because C# is more strict - the signature of the interface member must be exactly the same, implementing type cannot be used for interface member.
Here's the SDL schema if that will help... It's not my own and created by a third party.
Thanks. I think I have enough information to fix the problem.
This is result after the last update.
It's not perfectly optimal due to overhead of converting the collection types. I was considering to make all interface collection definitions as IEnumerable
which is covariant but that also comes with drawbacks of consuming.
wpgraphql_schema.txt I've attached the restult of the introspection query that you provided in https://github.com/Husqvik/GraphQlClientGenerator/issues/108