Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Conversation

@rybon
Copy link

@rybon rybon commented May 22, 2019

Based on #508 this time.

@rybon
Copy link
Author

rybon commented May 22, 2019

@IvanGoncharov how about this approach?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0007%) to 99.397% when pulling 9632003 on rybon:master into 3412b88 on graphql:master.

@IvanGoncharov
Copy link
Member

@rybon It feels more like a workaround. I don't want to maintain GraphiQL customization especially since GraphiQL maintainers planning big redesign effort for 1.0.0.

To better understand your use case can you please provide more details. Is it public or private API? Why having Prettify button is not enough in your case?

@rybon
Copy link
Author

rybon commented May 22, 2019

This does the same thing as the Prettify button, only automatically if autoPrettify is enabled in the options object. It does not require any changes to GraphiQL in this case. It makes use of the existing public API of GraphiQL.
It only affects the public API of this project on an opt-in basis.

I consider it useful for the following use case: from the Chrome debugger when opening a network request containing a stripped GraphQL query in a new tab where it is picked up by GraphiQL. This would show the stripped query, requiring a manual click on the Prettify button. Basically, this feature is a small ergonomic improvement to perform that click for you.

@IvanGoncharov
Copy link
Member

Basically, this feature is a small ergonomic improvement to perform that click for you.

How about adding a keyboard shortcut?
I think it will be supported by GraphiQL maintainers.

@rybon
Copy link
Author

rybon commented May 22, 2019

There is a keyboard shortcut. But this happens server-side, before the page is loaded so just opening the URL is enough.

@IvanGoncharov
Copy link
Member

@rybon Thanks for the PR but I don't think express-graphql should be in the business of modifying GraphiQL behavior.

I'm open to generic things like passing options or listing additional GraphiQL plugins (after GraphiQL 1.0.0) but I don't think the express-graphql should a place where you customize GraphiQL.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants