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

[4.0 Migration] Unable to await updateMany() #7695

Closed
mediafreakch opened this issue May 16, 2022 · 1 comment · Fixed by #7740
Closed

[4.0 Migration] Unable to await updateMany() #7695

mediafreakch opened this issue May 16, 2022 · 1 comment · Fixed by #7740
Labels

Comments

@mediafreakch
Copy link
Contributor

What you were expecting:

In v3.19.x I used to be able to await updateMany() using the returnPromise: true mutationOption.

What happened instead:

Does not work in v4.x. However it's still available with useUpdate().

If this change is intended could you outline in the migration docs how to mitigate this breaking change?

Steps to reproduce:

Related code:

const [updateMany, { data }] = useUpdateMany()

const onSubmit = async () => {
  await updateMany('posts', {
    ids: [1, 2],
    data: { ... }
  }, { 
    mutationMode: 'pessimistic',
    returnPromise: true
  })
}
@fzaninotto
Copy link
Member

Thanks for the report. You're right, the returnPromise option isn't implemented in updateMany. I'm marking it as a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants