Navigate:
~$QUERY0.1%

TanStack Query: Async state management and data fetching

Declarative server-state caching with automatic background synchronization.

LIVE RANKINGS • 06:52 AM • STEADY
OVERALL
#108
50
FRONTEND
#10
7
30 DAY RANKING TREND
ovr#108
·Front#10
STARS
48.1K
FORKS
3.6K
DOWNLOADS
707
7D STARS
+39
7D FORKS
+4
See Repo:
Share:

Learn more about query

TanStack Query is a JavaScript library for managing asynchronous server state in web applications through automated caching and synchronization mechanisms. It wraps data-fetching logic with intelligent background refetching, automatic cache invalidation, and optimistic updates to keep client-side state synchronized with server data sources. The library implements a query key system that maps data requests to cached entries, enabling automatic deduplication of concurrent requests and efficient cache management across component boundaries. It integrates with popular frontend frameworks like React, Vue, and Solid by providing hooks or primitives that connect component lifecycles to query states. The architecture prioritizes developer experience by handling loading states, error handling, and cache staleness policies declaratively without requiring manual coordination of network requests.

query

1

Protocol-agnostic fetching

Works with REST, GraphQL, or any promise-based data source without requiring framework-specific adapters. The same query logic can be reused across different API patterns.

2

Multi-framework support

Provides framework-specific implementations for React, Vue, Svelte, and Solid through separate packages that share a common query-core engine, allowing consistent patterns across different frontend stacks.

3

Built-in cache strategies

Implements automatic cache management with configurable stale-while-revalidate behavior, request deduplication, and background refetching without requiring manual cache invalidation logic in most cases.


import { useQuery } from '@tanstack/react-query';

function UserProfile({ userId }) {
  const { data, isLoading, error } = useQuery({
    queryKey: ['user', userId],
    queryFn: () => fetch(`/api/users/${userId}`).then(res => res.json())
  });

  if (isLoading) return <div>Loading...</div>;
  if (error) return <div>Error: {error.message}</div>;
  return <div>{data.name}</div>;
}

v@tanstack/vue-query@5.91.0

Adds support for passing a getter function to useQuery options, enabling reactive option composition in Vue.

  • Pass a getter function to useQuery options for dynamic, reactive query configuration in Vue components.
  • Release notes do not specify breaking changes, migration steps, or minimum version requirements.
v@tanstack/vue-query-devtools@6.0.0

Major version bump with no documented changes beyond a dependency update to @tanstack/vue-query@5.91.0.

  • Release notes do not specify breaking changes, migration steps, or new requirements for the v6 upgrade.
  • Review your dependency tree to ensure compatibility with the updated @tanstack/vue-query peer dependency.
v@tanstack/svelte-query@6.0.6

Patch release updating internal query-core dependency; no breaking changes or new requirements specified.

  • Update @tanstack/query-core to 5.90.8 for internal fixes or improvements.
  • Release notes do not specify breaking changes, migrations, or security fixes.

See how people are using query

Loading tweets...


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers