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

WIP: incremental payloads UI #3601

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

thomasheyenbrock
Copy link
Collaborator

@thomasheyenbrock thomasheyenbrock commented May 14, 2024

How it looks like for @defer/@stream: https://twitter.com/heyenbrock/status/1790134466960093476

How it looks like for subscriptions:

CleanShot.2024-05-14.at.12.14.27.mp4

TODOs:

  • make sure the tests pass
  • fix alignment of the new section with the secondary editors
  • check that the layout works when there is a footer

Copy link

changeset-bot bot commented May 14, 2024

🦋 Changeset detected

Latest commit: 6f3fcb3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
graphiql Minor
@graphiql/react Minor
@graphiql/plugin-code-exporter Major
@graphiql/plugin-explorer Major

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

return (
<div
className="graphiql-increment-editor"
style={isOpen ? { height: '30vh' } : {}}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For the editors to show properly I needed to give the wrapper a fixed height, which is not ideal. But I don't see a better way right now other than starting to do JS magic to calculate the container height on-runtime.

onClick={toggleEditor}
>
{props.isInitial ? 'Initial payload' : 'Increment'} (after{' '}
{props.increment.timing / 1000}s)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO: Show in ms if the timing is <1s, otherwise show seconds

Copy link

codecov bot commented May 14, 2024

Codecov Report

Attention: Patch coverage is 3.75000% with 77 lines in your changes are missing coverage. Please review.

Project coverage is 54.79%. Comparing base (03ab3a6) to head (6f3fcb3).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3601      +/-   ##
==========================================
- Coverage   55.32%   54.79%   -0.53%     
==========================================
  Files         115      117       +2     
  Lines        5352     5409      +57     
  Branches     1451     1472      +21     
==========================================
+ Hits         2961     2964       +3     
- Misses       1965     2017      +52     
- Partials      426      428       +2     
Files Coverage Δ
packages/graphiql-react/src/editor/tabs.ts 59.77% <0.00%> (-5.23%) ⬇️
packages/graphiql/src/components/GraphiQL.tsx 66.45% <22.22%> (-2.26%) ⬇️
packages/graphiql-react/src/utility/incremental.ts 0.00% <0.00%> (ø)
packages/graphiql-react/src/execution.tsx 13.27% <0.00%> (+0.11%) ⬆️
...react/src/editor/components/increments-editors.tsx 3.57% <3.57%> (ø)

Copy link
Contributor

github-actions bot commented May 16, 2024

The latest changes of this PR are available as canary in npm (based on the declared changesets):

Copy link
Contributor

@TallTed TallTed left a comment

Choose a reason for hiding this comment

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

trivial, for humans

// but technically it can also be a query or mutation where the fetcher
// decided to return an observable with either a single payload or
// multiple payloads (defer/stream). As the naming is part of the
// public API of this context we decide not to change it until defer/
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// public API of this context we decide not to change it until defer/
// public API of this context, we decided not to change it until defer/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants