-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fixes #48: add a prettify query button #64
Conversation
Awesome!! |
Interesting! I think we may want to improve the button affordance, it's not clear that it is clickable. One significant downside of this prettify technique is that it eats comments. Obviously not a big deal for cleaning up obfuscated queries that have no comments, but something to consider. |
I'm not sure how we can preserve comments. Sounds like something to fix on the graphql parser/printer side. I have intentionally made the |
That would be so useful with Relay |
const { onClick } = this.props; | ||
if (onClick) { | ||
e.preventDefault(); | ||
onClick(); |
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.
nit: maybe just this.props.onClick()
Sorry it took a while to get to this @gre. I think this is a nice feature addition - although we have a known issue with comments being deleted, I think this will be very useful for folks working with reduced/minimized query string, especially in Relay land. |
I'm so excited to have this in GraphiQL, @gre! :) |
me too :) |
@gre Could we squash the commits into one commit? |
@asiandrummer are you sure I should squash my commit and lose the history? is this really the convention here? (merge should hide the local branch history no?) |
@gre I was thinking we could only have a single or a couple commit related to the feature, for the readability of the commit history reasons. I was especially thinking we could include (or amend the message of) the 2nd commit if that's okay. Also I think merge actually shows the local branch history (#15), but I might be missing something :p |
this is squashed now |
Fixes #48: add a prettify query button
Update mocha to the latest version 🚀
This adds a protocol-compliant GraphQLConfig implementation, as well as an incomplete test suite for placeholder. Uses a new `[email protected]`.
addresses #48
it adds a
{}
prettify button. this is implemented usinggraphql
parse & print function:print(parse(this.state.query))
(pretty useful when you paste an obfuscated relay query and want to debug it)
on hover:
after clicking: