-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat: add @graphiql/react
package
#2370
feat: add @graphiql/react
package
#2370
Conversation
🦋 Changeset detectedLatest commit: 6e8a3e5 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 |
Awesome! I'll have a look in a bit! Regarding eslint, we should get https://github.com/graphql/graphiql/pulls/B2o5T merged, they might even resolve some issues? |
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, I like the cleanup around state, not having parent components dealing with child state anymore, but instead using the context.
The only thing is cleaning up the merge conflicts, apart from that good to go!
ace212a
to
f006a54
Compare
Codecov Report
@@ Coverage Diff @@
## main #2370 +/- ##
==========================================
- Coverage 65.70% 65.06% -0.65%
==========================================
Files 85 81 -4
Lines 5106 5255 +149
Branches 1631 1698 +67
==========================================
+ Hits 3355 3419 +64
- Misses 1747 1832 +85
Partials 4 4
Continue to review full report at Codecov.
|
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 great!
Co-authored-by: Laurin Quast <[email protected]>
c5c428f
to
6e8a3e5
Compare
this is a great start for |
} from 'graphql'; | ||
import copyToClipboard from 'copy-to-clipboard'; | ||
import { | ||
getFragmentDependenciesForAST, | ||
getOperationFacts, | ||
VariableToType, | ||
} from 'graphql-language-service'; | ||
import { SchemaReference } from 'codemirror-graphql/src/utils/SchemaReference'; |
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.
hmm, perhaps we should make this a top-level public export in codemirror-graphql
to set a good example. @imolorhe does this make sense to you?
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.
As far as I can tell, codemirror-graphql
currently doesn't have any top-level imports at all. Happy to follow up on this in another PR if it makes sense to you folks 🤗
Definitely! Will do this in a follow up to not bloat this PR too much 👍 |
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.
this is good to go, exactly the direction we need to move in!
This PR adds a new package
@graphiql/react
to the monorepo. The idea for this package is to provide all the building blocks (context providers, hooks to work with the state managed by the context, reusable components, etc.) for building a GraphiQL-like UI. The maingraphiql
package will become the reference implementation for how to use the components from@graphiql/react
.As a first step towards this goal, we add the following to the new package:
ExplorerContext
that shall contain all the state and logic related to the docs/explorer. We wrap with in a componentExplorerContextProvider
that has to be rendered at the top of the tree that contains other GraphiQL-components that need to access or change this state.useExplorerNavStack
.Notes:
eslint-plugin-react
version, otherwise using theplugin:react/jsx-runtime
did not work.GraphQLType
was used instead of theSchemaReference
type fromcodemirror-graphql
.