-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Upgrade to @graphql-ts/schema@1 #9535
Merged
Merged
+1,125
−1,120
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@graphql-ts/extend@1.0.3, npm/@graphql-ts/schema@0.6.4 |
bae5212
to
5f6fda7
Compare
5f6fda7
to
2146bb8
Compare
ed67a7b
to
eadc101
Compare
eadc101
to
8cb2d6e
Compare
99a471d
to
a2948cb
Compare
f0b5a71
to
ad17018
Compare
ad17018
to
5777d5c
Compare
5777d5c
to
b67c2ef
Compare
dcousens
approved these changes
Mar 12, 2025
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.
Amazing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates Keystone to
@graphql-ts/schema@1.0.0
which makes a few changes, the most notable thing for users is that they should usegWithContext
to bindg
(namedgraphql
in the current stable version of keystone, renamed tog
in #9460) to their ownContext
type from.keystone/types
instead of using theg
exported by@keystone-6/core
that is bound to the genericKeystoneContext
.This means that e.g. writing resolvers will have the correct context type.
The
g
type alias is used to help declaring types, particular for circular types, like this:Without the
g<typeof g.object<PersonSource>>
, TypeScript would error about the circularity. Previously this could be written withg.ObjectType<PersonSource>
, the types for this no longer exist, you should now use theg<typeof g.something<...>>
or imports from@keystone-6/core/graphql-ts
which re-exports types from@graphql-ts/schema
.Another notable change is that all the various types returned by e.g.
g.object
/etc. are now directly compatible withGraphQLObjectType
/etc. from GraphQL.js instead of being accessible at.graphQLType
on the returned object.Also, the minimum TypeScript version is now 5.7.