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

add useResponseEditor hook to @graphiql/react #2411

Merged
merged 9 commits into from
May 19, 2022

Conversation

thomasheyenbrock
Copy link
Collaborator

This moves over the logic for the last (read-only) editor: The response editor. We also move the ImagePreview component to @graphiql/react as it's only used in the useResponseEditor hook. This allows us to remove the utilities from graphiql that have been temporarily copied over in #2404 (commonKeys, importCodeMirror) as well as the CodeMirrorSizer utility (each editor takes care of resizing itself now using the useResizeEditor hook).

@changeset-bot
Copy link

changeset-bot bot commented May 19, 2022

🦋 Changeset detected

Latest commit: 81cd37a

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

This PR includes changesets to release 2 packages
Name Type
graphiql Minor
@graphiql/react Minor

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

@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #2411 (81cd37a) into main (2d91916) will increase coverage by 2.46%.
The diff coverage is 70.23%.

@@            Coverage Diff             @@
##             main    #2411      +/-   ##
==========================================
+ Coverage   65.70%   68.17%   +2.46%     
==========================================
  Files          85       76       -9     
  Lines        5106     4754     -352     
  Branches     1631     1558      -73     
==========================================
- Hits         3355     3241     -114     
+ Misses       1747     1509     -238     
  Partials        4        4              
Impacted Files Coverage Δ
packages/codemirror-graphql/src/hint.ts 94.73% <ø> (ø)
packages/codemirror-graphql/src/lint.ts 100.00% <ø> (ø)
packages/codemirror-graphql/src/results/mode.ts 47.05% <ø> (ø)
...kages/codemirror-graphql/src/utils/forEachState.ts 100.00% <ø> (ø)
packages/codemirror-graphql/src/utils/hintList.ts 95.65% <ø> (ø)
...ckages/codemirror-graphql/src/utils/mode-indent.ts 0.00% <0.00%> (ø)
packages/codemirror-graphql/src/variables/hint.ts 89.70% <ø> (ø)
packages/codemirror-graphql/src/variables/mode.ts 79.48% <ø> (ø)
packages/graphiql-react/src/editor/whitespace.ts 100.00% <ø> (ø)
...aphiql/src/components/DocExplorer/DefaultValue.tsx 50.00% <ø> (ø)
... and 89 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2025ba...81cd37a. Read the comment docs.

Copy link
Member

@timsuchanek timsuchanek left a comment

Choose a reason for hiding this comment

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

LGTM

Base automatically changed from feat/variable-editor-to-context to main May 19, 2022 19:50
@thomasheyenbrock thomasheyenbrock force-pushed the feat/result-editor-to-context branch from 33b32ee to 81cd37a Compare May 19, 2022 19:51
@acao
Copy link
Member

acao commented May 19, 2022

The latest changes of this PR are not available as canary, since there are no linked changesets for this PR.

@thomasheyenbrock thomasheyenbrock merged commit ad44869 into main May 19, 2022
@thomasheyenbrock thomasheyenbrock deleted the feat/result-editor-to-context branch May 19, 2022 20:32
@acao acao mentioned this pull request May 19, 2022
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.

4 participants