After generating my Go code, everything works as expected except for GraphQL Union Types. Here's an example of a GraphQL union type:
#...
union FooType = Bar | Baz
type Foo {
type: FooType
}
#...
The Go code being generated emits:
type Foo struct {
Bar
Baz
}
In the case where Bar and Baz have overlapping field names (likely the case), the Go compiler complains the struct fields for Bar and Baz repeat (as expected). I can certainly understand why this would be a challenge in Go, since you can't assign a struct field more than one type; one would need to use an interface in this case.
Perhaps the warning is just that and I don't need to worry about it?
After generating my Go code, everything works as expected except for GraphQL Union Types. Here's an example of a GraphQL union type:
The Go code being generated emits:
In the case where Bar and Baz have overlapping field names (likely the case), the Go compiler complains the struct fields for Bar and Baz repeat (as expected). I can certainly understand why this would be a challenge in Go, since you can't assign a struct field more than one type; one would need to use an interface in this case.
Perhaps the warning is just that and I don't need to worry about it?