Skip to content

fix(types): queryCache.getQueries#688

Merged
MichaelDeBoey merged 8 commits into
TanStack:masterfrom
jgettings:getQueries-types
Jul 2, 2020
Merged

fix(types): queryCache.getQueries#688
MichaelDeBoey merged 8 commits into
TanStack:masterfrom
jgettings:getQueries-types

Conversation

@jgettings

Copy link
Copy Markdown
Contributor

There were some missing types in the getQueries method's type definitions. I copied the parameter types from the other methods that allow AnyQueryKey | string | function, and added boolean as it looks like that's also a possible parameter type, looking at the implementation.

@smashercosmo

Copy link
Copy Markdown
Contributor
queryKeyOrPredicateFn:
      | AnyQueryKey
      | string
      | boolean
      | ((query: CachedQuery<unknown>) => boolean)

this type should be added to almost all queryCache methods: getQueryData, setQueryData, getQuery, getQueries
make sense to extract it into separate type:

type QueryKeyOrPredicateFn:
      | AnyQueryKey
      | string
      | boolean
      | ((query: CachedQuery<unknown>) => boolean)

@jgettings

Copy link
Copy Markdown
Contributor Author

@smashercosmo Sounds good! I wasn't sure how far I should go with it. I just pushed an update.

@jgettings

jgettings commented Jul 2, 2020

Copy link
Copy Markdown
Contributor Author

Sorry about all of the weird extraneous commits, I was just trying to get the checks into a good state, there seems to be a preexisting race condition/timeout/something in a test or two 😢

@MichaelDeBoey
MichaelDeBoey merged commit 04a1346 into TanStack:master Jul 2, 2020
@MichaelDeBoey

Copy link
Copy Markdown
Contributor

@all-contributors Please add @jgettings for code

@allcontributors

Copy link
Copy Markdown
Contributor

@MichaelDeBoey

I've put up a pull request to add @jgettings! 🎉

@tannerlinsley

Copy link
Copy Markdown
Member

🎉 This PR is included in version 2.4.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jgettings
jgettings deleted the getQueries-types branch July 2, 2020 23:54
@nx-cloud

nx-cloud Bot commented May 29, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 5e34696

Command Status Duration Result
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2m 2s View ↗
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-06-04 08:06:54 UTC

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 this pull request may close these issues.

4 participants