Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
under some circustance the code generated by StrawberryShake generate classes that do not compile due to a
Compiler Error CS0542 - 'user-defined type' : member names cannot be the same as their enclosing type
this happens when in a query definition is present a type with a property named as "[TypeName]Data"
the code generator Generate a class for each type named "[TypeName]Data" so any property in that type that has that name produce the compiler erroe CS0542
Steps to reproduce
write a simple query selecting a type that has a property named the same as the typeitself + "Data"
Example Schema Type:
type Test {
TestData: String
}
Relevant log output
Compiler Error CS0542 - 'user-defined type' : member names cannot be the same as their enclosing type
Additional Context?
I'm not familiar on what library is doing the code generator, but i found this bugs including in my .net core 7 project the preview package StrawberryShake.Server/13.0.0-preview.91 with his dependency
Is there an existing issue for this?
Describe the bug
under some circustance the code generated by StrawberryShake generate classes that do not compile due to a Compiler Error CS0542 - 'user-defined type' : member names cannot be the same as their enclosing type
this happens when in a query definition is present a type with a property named as "[TypeName]Data"
the code generator Generate a class for each type named "[TypeName]Data" so any property in that type that has that name produce the compiler erroe CS0542
Steps to reproduce
type Test { TestData: String }
Relevant log output
Additional Context?
I'm not familiar on what library is doing the code generator, but i found this bugs including in my .net core 7 project the preview package StrawberryShake.Server/13.0.0-preview.91 with his dependency
Product
Strawberry Shake
Version
13.0.0-preview.91