-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty but Duplicate Struct and Mutation in model file conflicting with client file. #199
Comments
Same problem. It would be nice if someone added settings for gqlgen, namely the omit_root_models setting |
It seems I found a solution after digging into the code! |
I am also having this problem. For me it started occurring when I tried to upgrade from 0.18.0 to 0.18.1. I'm a little confused because the only other changes in this PR are updates to dependencies, so I don't know why these extra structs would be added to the generated code. |
@ethomson1 @brthode |
Incidentally, the following settings are used to avoid generating Query and Mutation. https://github.com/Yamashou/gqlgenc/blob/master/example/github/.gqlgenc.yml |
@ethomson1 |
@Yamashou I noticed that setting to avoid generating Query and Mutation. When I added it to my gqlgenc.yml, it got rid of the Query and Mutation definitions in my client.go, while the empty ones in models_gen.go were still generated. I was unsure if that's what is expected to happen when specifying those options. If that's expected, then I will re-add those settings so that I can complete my upgrade. Thanks! |
That is the result of gqlgen's attempt to generate So, we recommend that you look for a way to prevent gqlgen from generating them |
Okay, I see that there was an |
@ethomson1 |
gqlgenc Versions: v0.16.0 & v0.18.1
Schema Source: Remote Server
Command
cd ${GODIR}/testutils/portalapi_gqlclient && go run github.com/Yamashou/gqlgenc@latest generate
gqlgen Version: v0.17.43
I needed to add some additional queries to my GraphQL client so I included them in my query file and then regenerated my client. After doing so I am seeing an empty Query and Mutation struct in my model file. (external_api_models_gen.go)
These conflict with the populated struct's in my client. (external-gql-client.go)
Partial .gqlgenc.yml config
I tried upgrading from v0.16.0 to v0.18.1 but am observing the same behavior for both versions. Given the change in behavior prior to the version change, I believe this was being exposed by a change in our GQL schema, but the number of changes is so numerous as to make tracking it down difficult.
The text was updated successfully, but these errors were encountered: