-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Only coerce items API input when using resolveFields: false #5517
Conversation
🦋 Changeset detectedLatest commit: a550f75 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 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 |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/BaKrMdjnWbej2toqcRZdHpwHkk3d |
83f7cbe
to
0a4ee8a
Compare
src | ||
} | ||
`, | ||
const data = await context.lists.Test.createOne({ |
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.
The changes in this PR allow this test to be re-written with the items API, where previously it would fail.
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. Latest deployment of this branch, based on commit a550f75:
|
0a4ee8a
to
ce6fcf7
Compare
ce6fcf7
to
a550f75
Compare
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.
I believe this is incorrect, I'm going to look into it more.
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.
I was incorrect, I interpreted this as "stop coercing the inputs completely" when really this is "let the graphql
function coerce the inputs"
The argument coercion applied in the items API should only be done in the code path where we're calling the mutations directly. In the case where we go through the GraphQL API itself we don't want to do this. For most field types it doesn't make a different but for
Upload
types it will convert an object of the forminto
which doesn't work as an input with the
graphql()
function which we use to execute server side GraphQL