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(swr): fix to use Array as key for useMutation #1546

Merged
merged 4 commits into from
Jul 28, 2024

Conversation

soartec-lab
Copy link
Member

@soartec-lab soartec-lab commented Jul 28, 2024

Status

READY

Description

fix #1487

the useMutation key should use same key as useSWR.
https://github.com/vercel/swr/blob/1585a3e37d90ad0df8097b099db38f1afb43c95d/src/mutation/types.ts#L236-L241

So, i fixed the get key function to return Array and hooks use Array as key for useMutation.
And, and, update the using url type in http fetcher from string to Key

Related PRs

none

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

none

@soartec-lab soartec-lab added bug Something isn't working swr SWR related issues labels Jul 28, 2024
@soartec-lab soartec-lab added this to the 7.0.1 milestone Jul 28, 2024
@melloware melloware merged commit 31f2f94 into orval-labs:master Jul 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working swr SWR related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SWR: keys generated for GETs are wrapped in an array while keys for mutations are not
2 participants