-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Inconsistencies in generated files #3414
Comments
Ok, that is definitely not the intention. If you upgrade to gqlgen v0.17.58 does the problem persist? I seem to recall some changes since then that might already have fixed this issue. |
Sorry to say, but the issue seems to still be present in v0.17.60 The issue is easily reproduced by both myself and others on my team. All you should have to do is run the same commands as that github action (delete the generated files and running |
From the action above updated to:
|
So I merged #3436 which may help with this, but I then tried to change all the I was also wondering if there was something that is running Very puzzling. I'll try to work on #3438 after day job and maybe that will just prevent it altogether. If you (or your folks) get a chance to take a look at #3438 that might speed things up. Thanks! |
What happened?
Each time gqlgen runs it almost randomly picks whether it will use
interface{}
orany
in some generated code. I know they function the same, but is there a way to make the generated output more consistent?I don't think my use case is specifically important, I assume having a consistent output when generating code would be good regardless. But the use case I have and how I'm reproducing the issue is with an automated test intended to catch when people change
.graphql
schema files and forget to regenerate the application code. I have the following test workflow:The test failed as the generated files had the following diff:
So I pushed exactly that change and nothing else:
And ran the test again but got the exact opposite from gqlgen:
What did you expect?
There should be no diff in the generated files if no changes are made to the source files they're generated from.
versions
go run github.com/99designs/gqlgen version 0.17.53
go version 1.23.1
The text was updated successfully, but these errors were encountered: