-
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
Allow custom resolver filenames using filename_template
option
#1085
Conversation
Regarding the failed test: It looks like removing the original This also happens on the master branch if the file gets removed before running the tests. This feels like a test that should have been updated? |
Placeholders are a little more future proof and self describing, eg filename_template: "{name}.custom.go" that said, whats the use case here? It would be very easy to break gqlgens output using this by not including the name part, or colliding it with another file in the dir by leaving the suffix off. Without a use case its hard judge the tradeoff. |
Thank you for your feedback. The current naming convention of Let me know if I should work on a second iteration of this PR. Otherwise feel free to close it! |
Ok, lets switch to a placeholder rather than %s and lets |
Great! I did replace the |
Any update on getting this merged ? |
This is a squash commit of #1085, required to fix the broken tests and resolve merge conflicts.
I've squash rebase merged this manually in ad675f0 to fix the broken tests |
This is a squash commit of 99designs#1085, required to fix the broken tests and resolve merge conflicts.
This PR adds a new
filename_template
option to theresolver
section.This allows us to get more control over the generated filenames when using the
follow-schema
layout.The new option is a string that is passed to
fmt.Sprintf
and receives the resolver's name as a parameter.If the option is empty, the format
%s.resolvers.go
is used.Before updating the relevant documentation I wanted to get feedback about the implementation and possible other solutions.