@tanstack/solid-query

中文文档
5.105.2发布于 2026/11/02MITTypeScriptESM + CJS构建来源已验证

Primitives for managing, caching and syncing asynchronous and remote data in Solid

原始使用文档
文档目录3 节
  1. Visit tanstack.com/query for docs, guides, API and more!
  2. Quick Features
  3. Become a Sponsor!
TanStack Solid Query

Hooks for fetching, caching and updating asynchronous data in Solid

#TanStack Release status semantic-release Join the discussion on Github Best of JS Gitpod Ready-to-Code

Enjoy this library? Try the entire TanStack! TanStack Table, TanStack Router, TanStack Virtual

Visit tanstack.com/query for docs, guides, API and more!

Quick Features

  • Transport/protocol/backend agnostic data fetching (REST, GraphQL, promises, whatever!)
  • Auto Caching + Refetching (stale-while-revalidate, Window Refocus, Polling/Realtime)
  • Parallel + Dependent Queries
  • Mutations + Reactive Query Refetching
  • Multi-layer Cache + Automatic Garbage Collection
  • Paginated + Cursor-based Queries
  • Load-More + Infinite Scroll Queries w/ Scroll Recovery
  • Request Cancellation
  • Suspense + Fetch-As-You-Render Query Prefetching
  • Dedicated Devtools

Become a Sponsor!

版本与发布记录

@tanstack/solid-query 共发布 498 个版本,首次发布于 2022/09/24;过去 12 个月发布了 95 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
5.105.2latest2026/11/02今天
5.105.12026/11/012 天前
5.105.02026/10/268 天前
5.104.52026/10/2014 天前
5.104.42026/10/1816 天前
5.104.32026/10/1519 天前

其他发布通道:alpha → 6.0.0-alpha.2,previous → 4.44.0,beta → 6.0.0-beta.8,rc → 6.0.0-rc.5。

关于 @tanstack/solid-query 的常见问题

@tanstack/solid-query 是什么?

在Solid中管理、缓存和同步异步和远程数据的原语

如何安装 @tanstack/solid-query?

在项目目录运行 npm install @tanstack/solid-query,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:solid-js(^1.6.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@tanstack/solid-query 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@tanstack/solid-query 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@tanstack/solid-query 可以商用吗?

@tanstack/solid-query 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@tanstack/solid-query 还在维护吗?

最新版本 5.105.2 发布于 2026/11/02(今天);至今共发布 498 个版本,其中过去 12 个月发布了 95 个;首次发布于 2022/09/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。