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(query): remove Promise from error type in query clients #1571

Conversation

soartec-lab
Copy link
Member

Status

READY/WIP/HOLD

Description

fix #1534

I removed unnecessary Promise from error response types when using query client.
Because the error variable doesn't need a Promise and there is no need to use await.

https://tanstack.com/query/latest/docs/framework/react/reference/useQuery

Before

const { data, error} = useCreatePets()
// const error: Ref | Ref<Promise>

After

const { data, error} = useCreatePets()
// const error: Ref | Ref

Related PRs

none

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

you can check error variable type in sample app

// samples/vue-query/custom-fetch/src/components/HelloWorld.vue

- const { data } = useListPets();
+ const { data, error } = useListPets();

@soartec-lab soartec-lab added bug Something isn't working tanstack-query TanStack Query related issue labels Aug 11, 2024
@soartec-lab soartec-lab requested a review from melloware August 11, 2024 03:23
@melloware melloware merged commit d689408 into orval-labs:master Aug 11, 2024
2 checks passed
@melloware melloware added this to the 7.0.2 milestone Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tanstack-query TanStack Query related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vue Query: error ref contains a ref to a Promise
2 participants