OneGraph / onegraph-changelog

Product Changelog for OneGraph using Persisted Queries

Home Page:https://onegraph.com/changelog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphiQL Explorer polish!

sgrove opened this issue · comments

We recently took some time to polish the Explorer a bit more and add some
feature requests that have cropped up!

Just update to 0.5.1 for all the new polish

isDeprecated styling support

First, deprecated fields now have a special class name for styling. In the future, we'll allow a function passed in as a prop from the developer that’ll be given each field, and can determine which class names should be applied. This should allow for all the flexibility necessary for a number of interesting use-cases that we'll share later.

explorer_deprecated_support

Actions revamp

We've also fixed the New <Query | Mutation | Subscription> buttons to the bottom of the explorer where they're always accessible without scrolling, and they also take up significantly less real-estate. One of the biggest challenges with the explorer is how to compactly represent all of the data and actions given such a small area (and potentially huge schema!).

The explorer will now automatically scroll the newly-added operation into view as well.

explorer_actions

Automatic __typename removal

And finally __typename will be automatically removed if it’s not the only field selection (only at the top level) and added back in if there are no other fields. We introduce this quirk in the second release because of the way GraphQL parses operations with no selections - which is to say, it just throws them out. It's a struggle to find the right user-experience given we don't want to fork the community with secondary parsers, etc. but I think this feel significantly nicer now!

remove_typename


To upgrade, just switch to "graphiql-explorer": "0.5.1" in your package.json!

Special thanks to @schmavery for taking the time to sit down (in person!) and work through building these features out with the OneGraph team!