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

Fix types for validateInput hook arguments on update operations #8819

Merged
merged 6 commits into from
Sep 20, 2023

Conversation

acburdine
Copy link
Member

@acburdine acburdine commented Sep 19, 2023

looks like these were updated incorrectly in #8808. Checked the other types and these appeared to be the only incorrect ones.

didn't create an issue/repro case since it seems to be a pretty straightforward bug/typo, though if I need to create an issue/repro let me know and I can do that 😄 I did vet out this change in my project via patch-package.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 19, 2023

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 d622b0d:

Sandbox Source
@keystone-6/sandbox Configuration

@dcousens dcousens self-assigned this Sep 20, 2023
@dcousens dcousens added the 🐛 bug Unresolved bug label Sep 20, 2023
@dcousens dcousens self-requested a review September 20, 2023 05:59
@dcousens
Copy link
Member

Thanks @acburdine!
I have extended the hooks example to ensure we get an error for this next time.

@@ -106,9 +131,14 @@ export const lists: Lists = {
return resolvedData;
},
},
validateInput: ({ context, inputData, addValidationError }) => {
validateInput: ({ context, operation, inputData, addValidationError }) => {
Copy link
Member

@dcousens dcousens Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intent is to replace this soon with per operation typed equivalent, equivalent to validate.create, validate.update and validate.delete, or similar. Like we have with resolveInput.

Or at least validateInput.create and validateInput.update for now.

@dcousens dcousens merged commit 52337e3 into keystonejs:main Sep 20, 2023
58 checks passed
@acburdine acburdine deleted the fix/hook-types branch September 20, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unresolved bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants