feat (graphiql-plugin-doc-explorer): virtualized schema types list in Docs pane#4253
feat (graphiql-plugin-doc-explorer): virtualized schema types list in Docs pane#4253simmerer wants to merge 17 commits into
Conversation
🦋 Changeset detectedLatest commit: 521fa38 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…h of schema types
|
@simmerer sorry about the flaky test failure, just bad timing. Should be fixed now, sou should be able to merge or rebase main and have that clear up! |
|
@simmerer thanks for the contribution! I have a couple initial thoughts and I'm interested to hear yours.
Separately, do you have a huge schema handy I could try this out against? 😅 |
|
@trevor-scheer Happy to go with your judgement either way on point 1. As far as 2, how about I switch to an There's a few great examples here of huge schemas: https://github.com/fotoetienne/big-federated-graphs, and edge0/composed.graphqls is the largest one. |
I think this is a reasonable point and don't mind the boolean prop. I'd be happy with that direction. I'm fairly new to this project so I'm going to ping @dimaMachina to see what he thinks and help calibrate my senses (mostly re: 1). If we don't hear from him in a timely fashion I'd say we can move forward with it. In the meantime (as you probably knew or have inferred by now), you can pretty trivially implement this as your own plugin and use it in lieu of the docs explorer until we land it. |
Adds virtualization for the top-level list of the Docs pane, keeping things performant for huge schemas.
The new
<VirtualList />component (employing@tanstack/react-virtual) is used for the "All Types" list in the Docs pane when there are more than 1000 elements. With 1000 or fewer, that list is simply rendered into the DOM as before.(I'm currently working with a schema that results in a list of more than 42,000 schema elements, and all of those items getting rendered directly into the DOM results in buggy/crashy behavior in the Docs pane.)