-
Notifications
You must be signed in to change notification settings - Fork 43
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
Inconsistent formatting of arguments #330
Comments
@sungam3r can you look at this? |
Oh, one more formatting issue 🤦♂️ . OK, but no exact timeline. |
@nightroman I think this is not a bug but a decision by design. Argument has its own line only if it has comment or description. Options:
|
@nightroman Also try to remove description from some other field, for example, |
The design might be questionable... but it is what it is, you might know all the reasons better. |
Just to see what happens or to "fix/adjust" formatting? I do not really want to use descriptions (add/remove) in order to adjust formatting. Besides, we do not always author descriptions, some of them are generated. E.g. in the provided example only |
Just to see what happens. I provided some options above. Do you have suggestions? |
I’d suggest option 2 for default behavior. Options would be good also of course. |
This looks reasonable to me as well. |
In general I’d agree with @nightroman that often descriptions are applied selectively in my schemas on an as needed basis. But it would be logical for arguments to either be on one line or separate lines, not a mix. And since adding a description usually requires a line for that, I’d add new lines to all if any did. That’s how I format source code when the |
OK, I'll go on with option 2. |
#358 combines all options |
Awesome! When is the new nuget update expected, approximately? Look forward trying this. |
Please find attached the project for reproducing the issue and follow the below steps.
TryGraphQLParser.zip
Steps
x1-type.graphql
is the input file to be formattedRun
This produces the new
x1-type.graphql.output.graphql
.The field arguments are formatted mostly as expected:
But the last argument
where: DesDesignItemFilterInput
formatting is inconsistent, it is expected to be on its own line:The text was updated successfully, but these errors were encountered: