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 SchemaContext to @graphiql/react #2420

Merged
merged 11 commits into from
May 23, 2022
Merged

Conversation

thomasheyenbrock
Copy link
Collaborator

Another rather big PR: Moving over the logic for fetching and validating the schema into a new context in @graphiql/react.

We still keep the schema inside GraphiQL state for now so that deriving operation facts can continue to work like before. Moving this logic over is next!

@changeset-bot
Copy link

changeset-bot bot commented May 21, 2022

🦋 Changeset detected

Latest commit: 65048ff

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

This PR includes changesets to release 2 packages
Name Type
graphiql Patch
@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 21, 2022

Codecov Report

Merging #2420 (663f818) into main (2d91916) will increase coverage by 3.34%.
The diff coverage is 70.35%.

❗ Current head 663f818 differs from pull request most recent head 65048ff. Consider uploading reports for the commit 65048ff to get more accurate results

@@            Coverage Diff             @@
##             main    #2420      +/-   ##
==========================================
+ Coverage   65.70%   69.05%   +3.34%     
==========================================
  Files          85       71      -14     
  Lines        5106     4498     -608     
  Branches     1631     1490     -141     
==========================================
- Hits         3355     3106     -249     
+ Misses       1747     1388     -359     
  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% <ø> (ø)
packages/graphiql-toolkit/src/storage/query.ts 36.73% <ø> (ø)
... 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 84d8985...65048ff. Read the comment docs.

@thomasheyenbrock thomasheyenbrock force-pushed the refactor/utils-to-toolkit branch from e817f50 to 903dbb7 Compare May 21, 2022 11:51
@timsuchanek
Copy link
Member

Wouldn't this even potentially fit into @graphiql/toolkit as it's mostly UI agnostic?
Not saying that it's a high prio, happy to optimize for speed here.

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!

@acao
Copy link
Member

acao commented May 22, 2022

@timsuchanek it would seem that way, but react context is still react specific.

I was thinking that if we move the state to something like zustand or xstate eventually, then we would have a js framework agnostic state implementation for toolkit. But this should be fine for now.

In vue they might use vuex, and sveltekit for svelte, so state manager implementations have become quite framework specific anyways

@thomasheyenbrock thomasheyenbrock force-pushed the refactor/utils-to-toolkit branch from 903dbb7 to 52afc40 Compare May 23, 2022 13:55
Base automatically changed from refactor/utils-to-toolkit to main May 23, 2022 14:47
@github-actions
Copy link
Contributor

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

@thomasheyenbrock thomasheyenbrock merged commit 3467cd3 into main May 23, 2022
@thomasheyenbrock thomasheyenbrock deleted the feat/schema-context branch May 23, 2022 15:26
@acao acao mentioned this pull request May 23, 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