-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[RFC] standard printer uses no comma between fields #54
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
Conversation
A couple issues have opened up about inconsistency in rendering graphql queries in the spec and in the ref impl - especially with respect to whitespace and commas. Here I'm proposing that it's easier to read queries where every field is always on it's own line (eg, no `image { width, height }` one-liners) and that lines are split only by line-terminators and not also commas. If there's agreement around this proposal, the second step will be to apply the printer to all graphql examples in the spec.
Makes sense to me. My only request would be a "russHanneman" flag where the delimiter is tres comas (",,,") rather than a single comma "," |
We also need to do a pass in the spec to make all examples conform to that |
Yeah, agreed; I think this is better. I do like the one-liners in some cases, but I don't think the standard printer should use them by any means. |
I'm waiting on spec cleanup to make sure everyone's cool with the format :) |
@dschafer I considered making the printer smarter but couldn't think about simple enough rules of when inlining is okay. Within the spec I'll go for fairly aggressive consistency, elsewhere I agree - inlining is terse and nice |
You may merge at will. |
[RFC] standard printer uses no comma between fields
Follow up on the spec can be found here graphql/graphql-spec@188cb06 |
adding an operation name of 'mutation' for a mutation query in a post request
This reverts commit e70934f.
A couple issues have opened up about inconsistency in rendering graphql queries in the spec and in the ref impl - especially with respect to whitespace and commas.
Here I'm proposing that it's easier to read queries where every field is always on it's own line (eg, no
image { width, height }
one-liners) and that lines are split only by line-terminators and not also commas.If there's agreement around this proposal, the second step will be to apply the printer to all graphql examples in the spec.