-
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
New option to make comments on resolver optional #2627
New option to make comments on resolver optional #2627
Conversation
@@ -68,16 +68,17 @@ func (m *Plugin) generateSingleFile(data *codegen.Data) error { | |||
continue | |||
} | |||
|
|||
resolver := Resolver{o, f, nil, "// foo", `panic("not implemented")`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, a fixed comment // // foo
is generated for all resolvers in single-file
mode, but it appears to me as if it was accidentally added to the code during development and was not intentional. Therefore, I have made a modification to generate the same comments as in follow-schema
mode.
I'm not at all sure why, but I'm repeatedly getting some test failures under windows and Go 1.20 which seem related to websockets. Given that the rest of the matrix passed, I'm imagining it's just a flaky test, but that's what's holding me up from merging this.
|
Ok, weird. 10th time was the charm, and now it finally passes for some reason. Anyone who wants to make that more reliable, I would be extremely grateful! |
After the PR #2263 , the
gqlgen generate
command started generating comments such as// Todos is the resolver for the todos field.
above resolver implementations. However, these comments are not necessary for me. So I added an option to not generate such comments.When
omit_template_comment: true
is set, the above comment will not be generated. However, pre-written comments are retained after the code re-generation. This feature is necessary to keep manually written comments.Relevent issues and PRs: #2413 , #2617
I have: