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(vue-query): useQueries options allow empty array and setup queryC… #4474

Closed
wants to merge 3 commits into from

Conversation

Naymi
Copy link
Contributor

@Naymi Naymi commented Nov 7, 2022

fixed: #4473

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 7, 2022

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 280e915:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-vue-basic Configuration
blazing-violet-rolnsr Issue #4473

@codecov-commenter
Copy link

Codecov Report

Base: 96.36% // Head: 92.39% // Decreases project coverage by -3.96% ⚠️

Coverage data is based on head (a534eb4) compared to base (eab6e2c).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4474      +/-   ##
==========================================
- Coverage   96.36%   92.39%   -3.97%     
==========================================
  Files          45       88      +43     
  Lines        2281     3644    +1363     
  Branches      640      958     +318     
==========================================
+ Hits         2198     3367    +1169     
- Misses         80      261     +181     
- Partials        3       16      +13     
Impacted Files Coverage Δ
src/core/hydration.ts
src/core/queryObserver.ts
src/react/useQueries.ts
src/devtools/theme.tsx
src/core/mutationCache.ts
src/react/reactBatchedUpdates.ts
src/core/retryer.ts
src/devtools/tests/utils.tsx
src/react/tests/utils.tsx
src/core/infiniteQueryObserver.ts
... and 123 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@DamianOsipiuk
Copy link
Contributor

@Naymi Thanks for the fix, but unfortunately we would not be able to accept it in this form.
This PR introduces a breaking change and it could be considered for v5.
For v4 however i would suggest to just change:

const queryClientKey = unreffedQueries[0].queryClientKey
const optionsQueryClient = unreffedQueries[0].queryClient

to

const queryClientKey = unreffedQueries[0]?.queryClientKey
const optionsQueryClient = unreffedQueries[0]?.queryClient

@Naymi
Copy link
Contributor Author

Naymi commented Nov 13, 2022

@NaymiСпасибо за исправление, но, к сожалению, мы не сможем принять его в таком виде. Этот PR вносит критическое изменение, и его можно рассмотреть для v5. Однако для v4 я бы предложил просто изменить:

const queryClientKey = unreffedQueries[0].queryClientKey
const optionsQueryClient = unreffedQueries[0].queryClient

к

const queryClientKey = unreffedQueries[0]?.queryClientKey
const optionsQueryClient = unreffedQueries[0]?.queryClient

Should I create a new pr?

@DamianOsipiuk
Copy link
Contributor

You can just update it to be in line with v4 API.

@Naymi
Copy link
Contributor Author

Naymi commented Nov 13, 2022

Already created another)
#4505

You can just update it to be in line with v4 API.

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.

[useQueries] Cannot read properties of undefined (reading 'queryClientKey')
4 participants