-
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
Add an example using Nexus to extend the Keystone schema #6792
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/HgHafYnCh7Zw73zHRKpGSCRTLTdN |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Note on the status of the Prisma plugin: I just read through graphql-nexus/nexus-plugin-prisma#1039 and it's being rewritten, the one you can use today only works with an older version of Prisma than the one that Keystone uses so we should definitely wait for the new one (here) is ready for use. |
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.
Nice example.
Getting the following when running yarn dev
and/or yarn dev-nexus
(doesn't matter the combination), regardless it all seems to work still:
When attempting to request nexusPosts
:
Aren't dates supposed to be ISO Strings?
Works if changed to toISOString()
and having a post with a publish date being in the future:
For the things
example, I can't pull out:
things {
id
title
}
Based on what the data looks like:
As there is a mismatch here:
Changing this on the fly it gets detected as a change:
But still fails to resolve until I restart Keystone itself:
After a restart:
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.
Works well.
This came up on Slack, and I was interested in testing out how to use Nexus to extend Keystone's GraphQL API. So I wrote up this example.
Turns out it's pretty neat, although there are a couple of limitations that we could improve in the future:
Nexus really wants you to run a watch process while you're coding, to regenerate types as you work. Since Keystone doesn't do hot reloading at the moment, I've added anot a problem anymore with the live reloading in Keystone nowdev-nexus
script which is completely hacky but gets the job done.