Skip to content
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

Feat: Request panel Schema #254

Merged
merged 9 commits into from
Jul 16, 2020
Merged

Feat: Request panel Schema #254

merged 9 commits into from
Jul 16, 2020

Conversation

sofiapoh
Copy link
Contributor

@sofiapoh sofiapoh commented May 25, 2020

This PR addresses #104 & #250: Adds a ✨ pretty ✨ view of the schema and a button to prettify your GraphQL request.

Fix #104
Fix #250

schema1

pretty

Screenshot 2020-05-25 at 14 55 40

Screenshot 2020-05-25 at 14 55 55

In terms of design, I've done my best to follow what we already have on the app + take inspiration from Firefox & Chrome devtools.
I've created some basic fixtures for some of the components but there are parts that could arguably be broken down further to better represents all the possible variations of the fields especially. I will also add the visual regression tests once I've received more feedback! I've also started work on a simple search for types on another branch but this could be merged before this as I'm not 100% sure when I'll have time to complete it. Since opening the PR I also added a search on the schema as it was a nice and relatively simple addition :-) As it is now it's very simple type search, in future it would be nice to improve it to search for any values in the schema including fields.

search

@sofiapoh sofiapoh added the Feature New feature or request label May 25, 2020
@andyrichardson
Copy link
Collaborator

@sofiapoh I was wracking my brain all weekend on how we could get navigation to work on this in a devtools-esque way - you've killed it!

I'll give this a try and code review today - so excited to get this merged!

@andyrichardson
Copy link
Collaborator

andyrichardson commented May 26, 2020

Just realized you added search too - holy moly!

The only visual thing I'm unsure about is the navigation. I really like how you've gone about it but I'm also aware that existing devtools design languages (including ours) try to keep interaction elements separate from "read-only" content.

Screenshot 2020-05-26 at 10 52 47
Example in chrome devtools console

Let me know if you think this does/doesn't work. We can always test both out on some users for feedback.

Screenshot 2020-05-26 at 10 57 37

@@ -163,22 +162,6 @@ const ChildrenName = styled.span`
font-size: 13px;
`;

const Arrow = styled(ArrowIcon)`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you cool with us keeping styles/elements like this colocated?

If we're reusing the style/icon I'm down for pulling it out into a shared folder but for one-time use cases, it's much easier to colocate and then break out when reuse occurs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I reused this on on the Schema view, would you prefer I don't put this stuff in the shared folder just for that?

@andyrichardson
Copy link
Collaborator

andyrichardson commented May 27, 2020

Quick todo for remaining blockers:

  • Add static navigation (breadcrumbs or action buttons)
  • Use identical layout to schema view for not DocumentNode types
  • Fix test snapshots - yarn test -u
  • Add new visual regression snapshots (fixtures look to cover all states!) - yarn visual-regression -u

Once those are out of the way, let's get this released 🚀

Copy link
Collaborator

@andyrichardson andyrichardson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome!

@andyrichardson andyrichardson merged commit f9bcb2b into master Jul 16, 2020
@wgolledge wgolledge deleted the request-panel branch August 17, 2020 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add query formatting Add full schema view to requests pane
2 participants