HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
TanStack
query
TypeScript2020–2024
TanStack / query

query

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.

15Distinct people
15Mentions
0Explicit recommenders
50.6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 11:56:56 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year15 dated mentions

Observed mentions: 2020-02-13 08:28:23 UTC to 2024-12-05 21:55:20 UTC.

02462020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 7 mentions; 3 submissions, 4 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC734
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC413
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC202
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC202

What Hacker News says

15 sources
Great to see this--there are some nice features that encourage using standard web technologies like forms, and some solid quality of life improvements. However, I'm disappointed (but not surprised, this was listed as out of scope for 19) that triggering Suspense is still basically "use a framework that supports it." I have not been able to find any documentation or blog posts about the mechanism. I've tried to figure out how it works by looking at TanStack Query, but I've had limited success so far. I've found they're copying React's twist on Promises [1], but I haven't gotten this to work yet. I know the general idea is you throw Promises, but Suspense explicitly forbids using promises created during rendering. This means you can't just interrupt the component's initial render to load some data, and then restart it when its data is avail
Read the rest
able. This means the component needs to deal with null data somehow, instead of, e.g., being able to call a custom `useSomeData` hook and rely on it to first suspend and then return the loaded data. Not having to deal directly with loading states in individual components could simplify things quite a bit. Has anyone explored this side of Suspense? [1]: https://github.com/TanStack/query/blob/main/packages/query-c...
In React 19
so cacheTime was really confusing because it seemed like "this is the amount time we cache data for", but that's not what it is. So a rename had to happen. We had some discussion on the public roadmap (https://github.com/TanStack/query/discussions/4252) about what it's gonna be. I'm usually against abbreviations, simply because there's always someone who doesn't understand what it means. But all other suggestions like inactiveCacheTime also had room for interpretation. gc is an abbreviation that is known well enough (think git gc), and it's also not an option that you will customize on a daily basis (usually once, globally).
In TanStack Query(a.k.a. React Query) v5 announced
> When I build libraries for React, ironically, I don't really use hooks like useState, useReducer, etc. One of the best perks (and footguns) of managing your state outside of react is that you get to have full control over when a component should rerender. I don't understand this quote from Tanner. Aren't React hooks, like, the only way to tell a function React component (while inside of it) to re-render? And if you look at the code of, say, the useBaseQuery hook of tanstack-query, you will indeed find React's native hooks being used there [0]. 0 - https://github.com/TanStack/query/blob/main/packages/react-q...
In React is holding me hostage
With `useSWR` the return type is export interface SWRResponse<Data = any, Error = any> { /** * The returned data of the fetcher function. */ data: Data | undefined /** * The error object thrown by the fetcher function. */ error: Error | undefined mutate: KeyedMutator<Data> isValidating: boolean isLoading: boolean } https://github.com/vercel/swr/blob/14956a840ac9b75fe321bf846... so if I check `isLoading` in my component then typescript isn't able to narrow/refine the type to something more specific since it isn't a sum type. While with react-query, it's a proper sum type that can be differentiated by checking `isLoading`. The type is actually quite long so here's just a bit export type QueryObserverResult<TData = unknown, TError = unknown> = | Query
Read the rest
ObserverIdleResult<TData, TError> | QueryObserverLoadingErrorResult<TData, TError> | QueryObserverLoadingResult<TData, TError> | QueryObserverRefetchErrorResult<TData, TError> | QueryObserverSuccessResult<TData, TError> export interface QueryObserverLoadingResult<TData = unknown, TError = unknown> extends QueryObserverBaseResult<TData, TError> { data: undefined error: null isError: false isIdle: false isLoading: true isLoadingError: false isRefetchError: false isSuccess: false status: 'loading' } https://github.com/TanStack/query/blob/9b21609350d9ad41faf5c... The key point in the type above is `isLoading: true` and `data: undefined`, which means if I check `isLoading === true`, then typescript knows the data is not available. SWR doesn't provide these guarantees.
In SWR 2.0 – React Hooks for Data Fetching
I recently created ~25 full-stack example projects using the most recent technologies and frameworks. I believe the following stack is the most productive, yet very scalable (doesn't use "leaky" abstractions). Frontend: - Good, old, Single Page App. I believe that all these SSR/isomorphic rendering frameworks are a lot of times just unnecessary complexity. - Vite.js + your preferred framework (Vite supports React/Vue/Svelte, etc). Backend: - Node.js + Typescript. - Trpc.io - while it's not "automatic generation of REST endpoints", it's very close. It's very easy to write your endpoints, and the added flexiblity/control is definitely worth the time spent writing them. - Trpc also has a built-in support for subscriptions: https://trpc.io/docs/subscriptions - Prisma + Postgres. Good, old, proven, flexible SQL database is always
Read the rest
a safe bet. And Prisma makes interacting with it an order of magnitude easier. - The whole "network layer" is completely and very efficiently handled by Trpc. It also uses React-query under the hood: https://github.com/TanStack/query. Infrastructure + deployments: - I would recommend going for AWS. - Frontend (statically built) can be hosted in S3 bucket behind a CDN. You should also properly configure caching headers returned by Cloudfront to make it work with SPA. - You can run your TRPC API in AWS Fargate container (behind ALB, or behind HTTP API GW). Alternatively, you can also run it in a lambda function. - To make the configuration of your Infrastructure/Packaging/Deployments 97% easier, have a look at https://stacktape.com (disclaimer: I'm a founder)
In Ask HN: Hunting for a Framework
Perhaps the React-Query source itself is a good example of when "simple" is still not "easy to read/write": I picked out this file pretty arbitrarily: https://github.com/TanStack/query/blob/main/packages/react-q... The author of react-query seems to be very clear at communicating how the library works and the library itself provides a great developer experience, but it's also an example of how much work can go into correct typing in library code.
In TypeScript is terrible for library developers

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.