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
Is there a better way of doing what I'm trying to do?
Ideally I'd be able to compose a struct out of other structs or interfaces that I use internally and gqlgen wouldn't force me to define on the composed object all the methods.
But would it be better if gqlgen generated an interface instead of a struct with fields for every type? That way I don't have to be running go generate ./... each time my struct changes and would only depend on the schema.graphql and the gqlgen.yml files.
We are using this in production and I'm wondering if we are using it in the wrong way because I can't seem to understand the use case for this kind of interface:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
What happened?
Embedded struct methods are not considered by
gqlgen
when looking at a model. If I'm reading the docs correctly, this should be allowed.What did you expect?
Embedded struct methods be considered by
gqlgen
when looking at a model.Minimal
graphql.schema
and models to reproduceI've commented out the two methods that make
gqlgen
happy, which are redundant the way I understand go.You can also clone this repo and run:
cd embedding && go run server/server.go
versions
gqlgen version
v0.9.1go version
go1.12.5 darwin/amd64Thoughts
Is there a better way of doing what I'm trying to do?
Ideally I'd be able to compose a
struct
out of other structs or interfaces that I use internally andgqlgen
wouldn't force me to define on the composed object all the methods.But would it be better if
gqlgen
generated aninterface
instead of astruct
with fields for every type? That way I don't have to be runninggo generate ./...
each time mystruct
changes and would only depend on theschema.graphql
and thegqlgen.yml
files.We are using this in production and I'm wondering if we are using it in the wrong way because I can't seem to understand the use case for this kind of
interface
:I'd much prefer this to be generated as:
Thanks!
The text was updated successfully, but these errors were encountered: