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

Add resolveInput.{create|update} list hooks #8551

Merged
merged 12 commits into from
May 9, 2023
Merged

Conversation

dcousens
Copy link
Member

@dcousens dcousens commented May 5, 2023

This pull request adds new resolveInput.{create|update} list hooks as shorthand equivalent of the resolveInput function.
The new resolveInput.{create|update} list hooks allow for more efficient and concise code by removing the need for routing branches if (operation === 'create') being littered throughout their code. This is not a breaking change, and you can still use operation if you need to.

Additionally, it fixes an issue with incompatible field key types when working with resolvedData (#8485).

TODO

  • Add a hooks example

@changeset-bot

This comment was marked as resolved.

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 5, 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.

@dcousens dcousens changed the title Fix incompatible field key types when working with resolvedData Add resolveInput.{create|update} list hooks May 5, 2023
@dcousens dcousens requested a review from borisno2 May 5, 2023 08:17
@borisno2
Copy link
Member

borisno2 commented May 8, 2023

Looks like the expected output in theList Error test in tests/api-tests/hooks/list-hooks.test.ts needs to be updated. What was User.hooks.resolveInput is now User.hooks.resolveInput.create

@dcousens dcousens force-pushed the resolve-input-and-types branch from 31b903e to 5f56684 Compare May 9, 2023 01:41
@dcousens dcousens self-assigned this May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants