-
Notifications
You must be signed in to change notification settings - Fork 1
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
initial code #1
initial code #1
Conversation
Approved the PR by mistake. |
src/lib/HasuraGraphiQL.tsx
Outdated
</table> | ||
<div | ||
className="graphiql-container" | ||
style={{ |
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.
Why isn't this a class? I don't see anything variable here.
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.
For some reason, this didn't work inside the 'graphiql-container` class even after adding !important. Probably some CSS specificity thing I don't fully understand. So, left this as such.
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.
That's probably because graphiql-container
is a graphiql specific class and it might not not be trivial to override it.
Would work if we write a separate class and pass the className of this div as graphiql-container custom-class
. This doesn't work either?
@beaussan do you mind signing off on this too? |
Have completely rewritten the code. Sorry about the re-review effort but the new code is shorter and simpler than the original and hopefully, easier to review. Design ChoicesData FlowDebouncing is done to prevent a bug in the code where when header info is typed and the checkbox is clicked without tabbing out, then two introspection queries are sent. Depending on which query wins the race the UI could look inconsistent. The issue is also prevalent in the console. See [here](https://drive.google.com/file/d/1wn0xI_Y0siSFGbiMdppPb11DCtqWtcl9/view?usp=sharing)Batched State UpdatesI have used composite objects along with useState to store related data. Felt this was easier to understand than using useReducer. |
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.
Looks good to me! Added a suggestion, but no biggie.
import * as React from "react"; | ||
import { IconChevronRight, IconChevronDown } from "./Icons"; | ||
|
||
export default function Collapsible({ |
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.
Nice :)
src/lib/HasuraGraphiQL.tsx
Outdated
</table> | ||
<div | ||
className="graphiql-container" | ||
style={{ |
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.
That's probably because graphiql-container
is a graphiql specific class and it might not not be trivial to override it.
Would work if we write a separate class and pass the className of this div as graphiql-container custom-class
. This doesn't work either?
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.
Much nicer than the initial version ! Left some small comments, nothing big tho ! 🎉
}) { | ||
const [collapsed, setCollapsed] = React.useState(false); | ||
|
||
return ( |
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.
Nitpicking here, but did you consider https://www.radix-ui.com/docs/primitives/components/collapsible ? It would cover all of the acceptability concern here
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.
Didn't really look into the application from an accessibility perspective. Found some more a11y problems. Will add a new GitHub issue to address this. Will update this comment with issue# in a while.
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.
Sounds good to me !
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.
Captured this concern in #2
Intro
This PR implements part of the RFC https://github.com/hasura/lux/blob/main/docs/rfcs/20210920_public_graphiql.md
(the second part is implemented by - https://github.com/hasura/lux/pull/3302 )
Design Notes
The UI/UX mimics the console API Explorer page.
Screenshot of API explorer -
Screenshot of this component -
The 'Relay' control is hidden for now as it's still unclear when we should show it. ( discussed with @wawhal )
The notification styles are also copied from the console UI/UX. (discussed with @martin-hasura )
We have used cypress component testing for the unit tests. RTL was considered and later discarded as it required mocking too many browser libs in this case.
Setup Instructions
See README.md