You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are trying to update from 0.7.2 to 0.8.3, and our schema has types like Content_User and Content_Post. Previously these would generate Go structs of the same name (Content_User and Content_Post), but now they generate structs without the underscore (ContentUser and ContentPost).
I don’t see that documented anywhere, but it’s not a major problem. I can make the changes to handle that. However, we also have a union type defined in the schema: union Content_Child = Content_User | Content_Post, which generates:
I don't have any experience working with the internals of gqlgen, but I feel this commit might have introduced this bug, in changing Is{{.Name }}() to Is{{.Name|go }}(): de3b7cb#diff-6d3fce6819ce4ba7bdbb9fd106746d78
What happened?
We are trying to update from 0.7.2 to 0.8.3, and our schema has types like
Content_User
andContent_Post
. Previously these would generate Go structs of the same name (Content_User
andContent_Post
), but now they generate structs without the underscore (ContentUser
andContentPost
).I don’t see that documented anywhere, but it’s not a major problem. I can make the changes to handle that. However, we also have a union type defined in the schema:
union Content_Child = Content_User | Content_Post
, which generates:As a result, neither type satisfies
ContentChild
.What did you expect?
I expected the underscore to get stripped from the
IsContent_Child
method, given that the interface refers toIsContentChild
.Minimal graphql.schema and models to reproduce
Schema:
versions
gqlgen version
? v0.8.3go version
? v1.12.4The text was updated successfully, but these errors were encountered: