-
Notifications
You must be signed in to change notification settings - Fork 168
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
Integrate GraphiQL Explorer into devtools #199
Integrate GraphiQL Explorer into devtools #199
Conversation
@sgrove: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
I've fixed up the hack and the sync issues by moving the schema fetch up outside of GraphiQL and into Explorer.js, it's pretty smooth now. There's a small visual glitch with the vs |
Thanks for all of your work on this @sgrove! I'm reviewing it now. Would you be able to sign the CLA? |
Sure, would be happy to. Just wanted to get feedback on the overall PR first. We have a new iteration of the editor coming along as well, but updating should be pretty trivial when we do release it https://www.youtube.com/watch?v=yWjCAjpHRt0 |
Signed the CLA, in case the notification hasn't come through yet! |
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.
Thanks very much for working on this @sgrove - this is awesome! (and sorry for the delay in getting this reviewed). LGTM - thanks again!
We just released a new version ~10 minutes ago 😂 https://www.onegraph.com/blog/2019/05/30/GraphiQL_Explorer_2_0_A_Power_User_Release.html Updating should be pretty simple, just bump to the |
Awesome @sgrove - great to hear. I'll get the new version in place. Thanks! |
Done via #209. |
And live in https://github.com/apollographql/apollo-client-devtools/releases/tag/v2.2.3. Thanks @sgrove! |
Could you please update screenshots on https://chrome.google.com/webstore/detail/jdkknkkbebbapilgoeccciglkfbmbnfm page to reflect that Explorer has been added? |
* Proof-of-concept of the GraphiQL Explorer integrated into devtools * Fixup sync and schema fetch problems * Cleanup * Slight graphiql top bar styling changes * Remove un-needed imports * Changelog update
There are a few bugs that come from my confusion around this, but as a proof of concept it works perfectly fine. Mainly, the explorer won't get the schema until GraphiQL has loaded it up and there's been one state-invalidating thing to happen (e.g. typing in the query or clicking a button). If there's an easy way to get the schema in this component, it'd be a trivial swap.
The other concern is getting the current query text from the GraphiQL instance into the explorer - right now I store it in the state, but it could just as easily pull it from the editor state, just like the
prettify
action does.Finally, I introduced a
getIn
helper to safely deal with deeply-nested attributes that might have nullable properties along the path, but it may not really be useful if there's an easier, more direct way to get the schema.@jbaxleyiii Would be great to know what needs to change to actually get this to the right quality level and merged in!
Here's a demo video of using it in action: