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

feat: make InfiniteQueryObserver's type more robust #3571

Merged
merged 1 commit into from Jun 5, 2022
Merged

feat: make InfiniteQueryObserver's type more robust #3571

merged 1 commit into from Jun 5, 2022

Conversation

liaoliao666
Copy link
Contributor

Currently i face with this problem that i defined a InfiniteQueryObserverOptions that contains QueryKey. and then i pass it into InfiniteQueryObserver. but unfortunately its not compatible with options of InfiniteQueryObserver's constructor

@vercel
Copy link

vercel bot commented Apr 29, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
react-query ✅ Ready (Inspect) Visit Preview Apr 29, 2022 at 2:45AM (UTC)

@codesandbox-ci
Copy link

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 bba101e:

Sandbox Source
tannerlinsley/react-query: basic Configuration
tannerlinsley/react-query Configuration

@codecov
Copy link

codecov bot commented Apr 29, 2022

Codecov Report

Merging #3571 (bba101e) into beta (fdbc002) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             beta    #3571   +/-   ##
=======================================
  Coverage   96.93%   96.93%           
=======================================
  Files          47       47           
  Lines        2381     2381           
  Branches      709      709           
=======================================
  Hits         2308     2308           
  Misses         71       71           
  Partials        2        2           
Impacted Files Coverage Δ
src/core/infiniteQueryBehavior.ts 100.00% <ø> (ø)
src/core/infiniteQueryObserver.ts 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fdbc002...bba101e. Read the comment docs.

@TkDodo
Copy link
Collaborator

TkDodo commented May 1, 2022

I think it looks good, but could you maybe show an example that didn't work before? Best would be a type level test that fails on master, but works on your PR. Thanks

@liaoliao666
Copy link
Contributor Author

InfiniteQueryObserverOptions

https://codesandbox.io/s/broken-bird-5f8usv?file=/src/App.tsx

u can see this example
it's not assignable to InfiniteQueryObserver when i pass a options with type QueryKey

@TkDodo TkDodo merged commit 97484dc into TanStack:beta Jun 5, 2022
@tannerlinsley
Copy link
Collaborator

🎉 This PR is included in version 4.0.0-beta.21 🎉

The release is available on:

Your semantic-release bot 📦🚀

GLabat pushed a commit to GLabat/react-query that referenced this pull request Jun 27, 2022
…k-beta

* 'beta' of https://github.com/TanStack/query: (140 commits)
  Fix Best of JS badge in README (TanStack#3695)
  Update config.json
  docs: adapter teasers
  docs: rewrite typescript docs
  tests: stabilize
  docs: Update graphql.md to fix link (TanStack#3683)
  docs: fix link typo in README.md (TanStack#3679)
  Update README.md
  update readme
  Update config.json
  Update index.js
  examples: vendor to platform directories
  docs: migrate to tanstack.com
  fix(persist): introduce in-house synchronous Storage interface (TanStack#3673)
  docs: restructure migration guide by importance of breaking changes
  fix: `replaceDeepEqual` special case for non-plain arrays (TanStack#3669)
  feat: make InfiniteQueryObserver's type more robust (TanStack#3571)
  fix(types): remove non-void constraint from queryFn result (TanStack#3666)
  fix(persist): remove environment check (TanStack#3658)
  fix(types): make sure queryClient.setQueriesData can return undefined from the updater (TanStack#3657)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants