{"_id":"reactive-query-z","_rev":"31-91df90034f040f73b5c9a1df48e92d76","name":"reactive-query-z","dist-tags":{"zx":"3.0.0-zx","latest":"3.2.0"},"versions":{"1.0.0":{"name":"reactive-query-z","version":"1.0.0","keywords":["react","intent","intent-engine","orchestration","state-management","architecture","ddd","hexagonal","side-effects","async-flow","react-hooks","react-library","graphql","rest"],"author":{"name":"Delpi.Kye"},"license":"MIT","_id":"reactive-query-z@1.0.0","maintainers":[{"name":"delpikye","email":"tungvu.it@gmail.com"}],"homepage":"https://github.com/delpikye-v/reactive-query#readme","bugs":{"url":"https://github.com/delpikye-v/reactive-query/issues"},"dist":{"shasum":"a92cfd876a9722c5cf824d5f985847f0785d6917","tarball":"https://registry.npmjs.org/reactive-query-z/-/reactive-query-z-1.0.0.tgz","fileCount":20,"integrity":"sha512-pgj1CPrJmgB7JnABqRf3pdxQinDywKYwd0E0cddnRTBaaS8f/REBbcqswKO1s5ymeOp3DgQSO8K/iEYMJCNhcg==","signatures":[{"sig":"MEUCIFMnT3rtDTVD7a3kaa54ORkyTvObXWc/A7EDUpmkM3IcAiEAtqRERJdNWjybpEboQgGKwXyww/eUeIWtBx7nt9o08I4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44551},"main":"build/index.cjs","types":"build/index.d.ts","module":"build/index.esm.js","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.esm.js","require":"./build/index.cjs"}},"gitHead":"5ff52576a11fd5dc581b5374d70b2d8b67e6165d","scripts":{"cb":"npm run clean && npm run build","build":"rollup -c","clean":"rimraf build","prepublishOnly":"npm run build"},"_npmUser":{"name":"delpikye","email":"tungvu.it@gmail.com"},"repository":{"url":"git+https://github.com/delpikye-v/reactive-query.git","type":"git"},"_npmVersion":"11.6.2","description":"Intent-first orchestration engine for React applications with support for REST and GraphQL","directories":{},"sideEffects":false,"_nodeVersion":"25.1.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.56.3","typescript":"^4.4.2","@types/react":"^17.0.90","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^17.1.0","rollup-plugin-typescript2":"^0.29.0","@rollup/plugin-node-resolve":"^11.2.1","rollup-plugin-peer-deps-external":"^2.2.4"},"peerDependencies":{"react":">=17"},"_npmOperationalInternal":{"tmp":"tmp/reactive-query-z_1.0.0_1767112568949_0.10034352471675989","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"reactive-query-z","version":"2.0.0","keywords":["react","intent","intent-engine","orchestration","state-management","architecture","ddd","hexagonal","side-effects","async-flow","react-hooks","react-library","graphql","rest"],"author":{"name":"Delpi.Kye"},"license":"MIT","_id":"reactive-query-z@2.0.0","maintainers":[{"name":"delpikye","email":"tungvu.it@gmail.com"}],"homepage":"https://github.com/delpikye-v/reactive-query#readme","bugs":{"url":"https://github.com/delpikye-v/reactive-query/issues"},"dist":{"shasum":"668b612110242905de6e3d5516fcb8c41814c3ab","tarball":"https://registry.npmjs.org/reactive-query-z/-/reactive-query-z-2.0.0.tgz","fileCount":21,"integrity":"sha512-xXNYcUJhtIxP1Rdn+WaoReqZcH/CNBpeD5T8j+zc76lf3fDMU1y1ssQcv04xoIskNp0pE+L0Jwe4YNAHzFiXcQ==","signatures":[{"sig":"MEUCIAzP2uwXuIyLTKoMYbhCSMswKVSRLqPk58J7c6A9WzMfAiEAn41XMQwjRTOCxvUkQhLRSDRD3qXoKXEIa10OaYyjlBY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49325},"main":"build/index.cjs","types":"build/index.d.ts","module":"build/index.esm.js","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.esm.js","require":"./build/index.cjs"}},"gitHead":"5ff52576a11fd5dc581b5374d70b2d8b67e6165d","scripts":{"cb":"npm run clean && npm run build","build":"rollup -c","clean":"rimraf build","prepublishOnly":"npm run build"},"_npmUser":{"name":"delpikye","email":"tungvu.it@gmail.com"},"repository":{"url":"git+https://github.com/delpikye-v/reactive-query.git","type":"git"},"_npmVersion":"11.6.2","description":"Query is a lightweight, reactive library for data fetching and state orchestration in React.","directories":{},"sideEffects":false,"_nodeVersion":"25.1.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.56.3","typescript":"^4.4.2","@types/react":"^17.0.90","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^17.1.0","rollup-plugin-typescript2":"^0.29.0","@rollup/plugin-node-resolve":"^11.2.1","rollup-plugin-peer-deps-external":"^2.2.4"},"peerDependencies":{"react":">=17"},"_npmOperationalInternal":{"tmp":"tmp/reactive-query-z_2.0.0_1767115036296_0.19496765309051511","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"reactive-query-z","version":"2.1.0","keywords":["react","intent","intent-engine","orchestration","state-management","architecture","ddd","hexagonal","side-effects","async-flow","react-hooks","react-library","graphql","rest"],"author":{"name":"Delpi.Kye"},"license":"MIT","_id":"reactive-query-z@2.1.0","maintainers":[{"name":"delpikye","email":"tungvu.it@gmail.com"}],"homepage":"https://github.com/delpikye-v/reactive-query#readme","bugs":{"url":"https://github.com/delpikye-v/reactive-query/issues"},"dist":{"shasum":"649cd6835abb90b57437f30a209f5a8de9aebc28","tarball":"https://registry.npmjs.org/reactive-query-z/-/reactive-query-z-2.1.0.tgz","fileCount":22,"integrity":"sha512-x7r+aQd429byPhufFtWjbzWvQc4/eE5uMPoL/lLbDUhoRNl0qXSbtAmvw9742A3DamzO4uQjIFpBOUPCzrjN5Q==","signatures":[{"sig":"MEYCIQDNJx9hT5BBL/TQKvzfiL/z2ULiPXgm7p0pTO3cZukVdQIhAN9ilcvdsEaaPeCYqLOuR3a5ZTZhEnoiAdhMNd+jQmtE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49150},"main":"build/index.cjs","types":"build/index.d.ts","module":"build/index.esm.js","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.esm.js","require":"./build/index.cjs"}},"gitHead":"5ff52576a11fd5dc581b5374d70b2d8b67e6165d","scripts":{"cb":"npm run clean && npm run build","build":"rollup -c","clean":"rimraf build","prepublishOnly":"npm run build"},"_npmUser":{"name":"delpikye","email":"tungvu.it@gmail.com"},"repository":{"url":"git+https://github.com/delpikye-v/reactive-query.git","type":"git"},"_npmVersion":"11.6.2","description":"Query is a lightweight, reactive library for data fetching and state orchestration in React.","directories":{},"sideEffects":false,"_nodeVersion":"25.1.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.56.3","typescript":"^4.4.2","@types/react":"^17.0.90","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^17.1.0","rollup-plugin-typescript2":"^0.29.0","@rollup/plugin-node-resolve":"^11.2.1","rollup-plugin-peer-deps-external":"^2.2.4"},"peerDependencies":{"react":">=17"},"_npmOperationalInternal":{"tmp":"tmp/reactive-query-z_2.1.0_1767116393825_0.0025774125565030115","host":"s3://npm-registry-packages-npm-production"}},"3.0.0-zx":{"name":"reactive-query-z","version":"3.0.0-zx","keywords":["react","intent","intent-engine","orchestration","state-management","architecture","ddd","hexagonal","side-effects","async-flow","react-hooks","react-library","graphql","rest"],"author":{"name":"Delpi.Kye"},"license":"MIT","_id":"reactive-query-z@3.0.0-zx","maintainers":[{"name":"delpikye","email":"tungvu.it@gmail.com"}],"homepage":"https://github.com/delpikye-v/reactive-query#readme","bugs":{"url":"https://github.com/delpikye-v/reactive-query/issues"},"dist":{"shasum":"71aa242e77511d22b6749812d5d81ddf9df23a10","tarball":"https://registry.npmjs.org/reactive-query-z/-/reactive-query-z-3.0.0-zx.tgz","fileCount":20,"integrity":"sha512-CY0TFIRcGw4ML9ml0tdkmiw7ovLcOGPRPHoZNKNnklmNyO/nurSzZVwNlVbKaRKyy1CITWbaZdp6KBm6OMjOwQ==","signatures":[{"sig":"MEQCIG+MFHhtFOxmZQDfON4mh+8unNRq6RRPY8Wa+1Ag67gJAiAZT2MkRzJtq5QJckG9ozR85S/Mrdg1Ki/L6OvsShlExg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49888},"main":"build/index.cjs","types":"build/index.d.ts","module":"build/index.esm.js","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.esm.js","require":"./build/index.cjs"}},"gitHead":"bc988bc193415a98c4064b0b88343691c9923612","scripts":{"cb":"npm run clean && npm run build","build":"rollup -c","clean":"rimraf build","prepublishOnly":"npm run build"},"_npmUser":{"name":"delpikye","email":"tungvu.it@gmail.com"},"repository":{"url":"git+https://github.com/delpikye-v/reactive-query.git","type":"git"},"_npmVersion":"11.6.2","description":"Query is a lightweight, reactive library for data fetching and state orchestration in React.","directories":{},"sideEffects":false,"_nodeVersion":"25.1.0","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tslib":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.56.3","typescript":"^4.4.2","@types/react":"^17.0.90","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^17.1.0","rollup-plugin-typescript2":"^0.29.0","@rollup/plugin-node-resolve":"^11.2.1","rollup-plugin-peer-deps-external":"^2.2.4"},"peerDependencies":{"react":">=17"},"_npmOperationalInternal":{"tmp":"tmp/reactive-query-z_3.0.0-zx_1767372998912_0.8557879911823871","host":"s3://npm-registry-packages-npm-production"}},"3.0.1":{"name":"reactive-query-z","version":"3.0.1","keywords":["react","intent","intent-engine","orchestration","state-management","architecture","ddd","hexagonal","side-effects","async-flow","react-hooks","react-library","graphql","rest"],"author":{"name":"Delpi.Kye"},"license":"MIT","_id":"reactive-query-z@3.0.1","maintainers":[{"name":"delpikye","email":"tungvu.it@gmail.com"}],"homepage":"https://github.com/delpikye-v/reactive-query#readme","bugs":{"url":"https://github.com/delpikye-v/reactive-query/issues"},"dist":{"shasum":"061350fd25ee719494a1c6d7e89b1ee482f1d6c6","tarball":"https://registry.npmjs.org/reactive-query-z/-/reactive-query-z-3.0.1.tgz","fileCount":20,"integrity":"sha512-Jq73FR3LKb1KcLFoEOk3BnxQjMzY4qC+W1wzQ/sb3arO4Ps15FGNiW6uMVXEq5w1UQUZyeWKaat8AVdBjAhNfg==","signatures":[{"sig":"MEUCIQC2Kd79H9jrNTkWnEqZydjAksvE1AXaVmHSsEKtR5MzDgIgCkXoiYRuT6i5Yg/+Gq3hclK/0V/TWvMIrMbqFEFFSrc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49842},"main":"build/index.cjs","types":"build/index.d.ts","module":"build/index.esm.js","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.esm.js","require":"./build/index.cjs"}},"gitHead":"bc988bc193415a98c4064b0b88343691c9923612","scripts":{"cb":"npm run clean && npm run build","build":"rollup -c","clean":"rimraf build","prepublishOnly":"npm run build"},"_npmUser":{"name":"delpikye","email":"tungvu.it@gmail.com"},"repository":{"url":"git+https://github.com/delpikye-v/reactive-query.git","type":"git"},"_npmVersion":"11.6.2","description":"Query is a lightweight, reactive library for data fetching and state orchestration in React.","directories":{},"sideEffects":false,"_nodeVersion":"25.1.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.56.3","typescript":"^4.4.2","@types/react":"^17.0.90","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^17.1.0","rollup-plugin-typescript2":"^0.29.0","@rollup/plugin-node-resolve":"^11.2.1","rollup-plugin-peer-deps-external":"^2.2.4"},"peerDependencies":{"react":">=17"},"_npmOperationalInternal":{"tmp":"tmp/reactive-query-z_3.0.1_1767373375862_0.6289458442346438","host":"s3://npm-registry-packages-npm-production"}},"3.1.0":{"name":"reactive-query-z","version":"3.1.0","keywords":["react","intent","intent-engine","orchestration","state-management","architecture","ddd","hexagonal","side-effects","async-flow","react-hooks","react-library","graphql","rest"],"author":{"name":"Delpi.Kye"},"license":"MIT","_id":"reactive-query-z@3.1.0","maintainers":[{"name":"delpikye","email":"tungvu.it@gmail.com"}],"homepage":"https://github.com/delpikye-v/reactive-query#readme","bugs":{"url":"https://github.com/delpikye-v/reactive-query/issues"},"dist":{"shasum":"b815bb89957b15c51da49a882c354e215aebe913","tarball":"https://registry.npmjs.org/reactive-query-z/-/reactive-query-z-3.1.0.tgz","fileCount":20,"integrity":"sha512-YXapFM4CTUCJ+bepBPX1RDxT9NRmrPiIxkkxXEhQ2ic6oVSvMf36NwfQKj26B7JpyArwS0rdxQCDhPqWqmirnA==","signatures":[{"sig":"MEYCIQDWD46ssqp4F/bCGKW00LbNWAbD/mdP5dInMgViwM5ByQIhAJQpI8VH6d2JFZRt013sMOFjJIn0POUTcd7Up7GNHcqf","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54417},"main":"build/index.cjs","types":"build/index.d.ts","module":"build/index.esm.js","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.esm.js","require":"./build/index.cjs"}},"gitHead":"4bd4620d7ec0f60d522007eb7e46e0927337b449","scripts":{"cb":"npm run clean && npm run build","build":"rollup -c","clean":"rimraf build","prepublishOnly":"npm run build"},"_npmUser":{"name":"delpikye","email":"tungvu.it@gmail.com"},"repository":{"url":"git+https://github.com/delpikye-v/reactive-query.git","type":"git"},"_npmVersion":"11.6.2","description":"Lightning-fast state & API handling, reactive library for data fetching and state orchestration in React.","directories":{},"sideEffects":false,"_nodeVersion":"25.1.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.3.1","rimraf":"^3.0.2","rollup":"^2.56.3","typescript":"^4.4.2","@types/react":"^17.0.90","rollup-plugin-terser":"^7.0.2","@rollup/plugin-commonjs":"^17.1.0","rollup-plugin-typescript2":"^0.29.0","@rollup/plugin-node-resolve":"^11.2.1","rollup-plugin-peer-deps-external":"^2.2.4"},"peerDependencies":{"react":">=17"},"_npmOperationalInternal":{"tmp":"tmp/reactive-query-z_3.1.0_1768073635191_0.9763808854090918","host":"s3://npm-registry-packages-npm-production"}},"3.2.0":{"name":"reactive-query-z","version":"3.2.0","description":"A lightweight React data-fetching library with caching, mutations, REST & GraphQL support, and request deduplication.","license":"MIT","author":{"name":"Delpi.Kye"},"sideEffects":false,"main":"build/index.cjs","module":"build/index.esm.js","types":"build/index.d.ts","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.esm.js","require":"./build/index.cjs"}},"scripts":{"clean":"rimraf build","build":"rollup -c","cb":"npm run clean && npm run build","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/delpikye-v/reactive-query.git"},"homepage":"https://github.com/delpikye-v/reactive-query#readme","bugs":{"url":"https://github.com/delpikye-v/reactive-query/issues"},"keywords":["react","react-query","data-fetching","api","cache","query","mutation","async","hooks","react-hooks","graphql","rest","state-management","subscription","websocket","sse"],"peerDependencies":{"react":">=17"},"dependencies":{},"devDependencies":{"@rollup/plugin-commonjs":"^17.1.0","@rollup/plugin-node-resolve":"^11.2.1","@types/react":"^17.0.90","rimraf":"^3.0.2","rollup":"^2.56.3","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","typescript":"^4.4.2","tslib":"^2.3.1"},"gitHead":"e6fdb861086ca616b8b1542b8770b04dec2d5dd6","_id":"reactive-query-z@3.2.0","_nodeVersion":"25.1.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-TDlWAou9jtbweMmBVUY2k+CFwXpf2KhLlFYLVfvZqJ0NjND+u/sV+N1kKeS+Y+H++e+MV2s4cIE/13zztzUmAw==","shasum":"f9286655dea388f94913801a197abf6bf9aa0b4f","tarball":"https://registry.npmjs.org/reactive-query-z/-/reactive-query-z-3.2.0.tgz","fileCount":24,"unpackedSize":45540,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCi5dv6mgamW1mjWdD91AaAdnH52+P33QMSKPjlYN520QIhAKzfdgdAiAyAJfp2RtLXz5JdgE2GQBMYbixx6H39F3jd"}]},"_npmUser":{"name":"delpikye","email":"tungvu.it@gmail.com"},"directories":{},"maintainers":[{"name":"delpikye","email":"tungvu.it@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/reactive-query-z_3.2.0_1769529061526_0.6539675622648742"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-30T16:36:08.948Z","modified":"2026-01-27T15:51:01.828Z","1.0.0":"2025-12-30T16:36:09.095Z","1.1.0":"2025-12-30T17:14:11.519Z","2.0.0":"2025-12-30T17:17:16.454Z","2.0.1":"2025-12-30T17:32:42.925Z","2.1.0":"2025-12-30T17:39:53.984Z","2.2.0":"2025-12-31T04:41:39.255Z","3.0.0":"2025-12-31T21:56:16.139Z","3.0.0-zx":"2026-01-02T16:56:39.063Z","3.0.1":"2026-01-02T17:02:55.996Z","3.0.2":"2026-01-10T19:30:53.060Z","3.0.3":"2026-01-10T19:31:16.155Z","3.0.4":"2026-01-10T19:31:33.277Z","3.0.5":"2026-01-10T19:31:54.320Z","3.0.6":"2026-01-10T19:32:11.769Z","3.0.7":"2026-01-10T19:32:42.241Z","3.0.8":"2026-01-10T19:33:05.079Z","3.0.9":"2026-01-10T19:33:28.514Z","3.1.0":"2026-01-10T19:33:55.342Z","3.2.0":"2026-01-27T15:51:01.695Z"},"bugs":{"url":"https://github.com/delpikye-v/reactive-query/issues"},"author":{"name":"Delpi.Kye"},"license":"MIT","homepage":"https://github.com/delpikye-v/reactive-query#readme","keywords":["react","react-query","data-fetching","api","cache","query","mutation","async","hooks","react-hooks","graphql","rest","state-management","subscription","websocket","sse"],"repository":{"type":"git","url":"git+https://github.com/delpikye-v/reactive-query.git"},"description":"A lightweight React data-fetching library with caching, mutations, REST & GraphQL support, and request deduplication.","maintainers":[{"name":"delpikye","email":"tungvu.it@gmail.com"}],"readme":"# 🗄️ reactive-query-z\n\n[![NPM](https://img.shields.io/npm/v/reactive-query-z.svg)](https://www.npmjs.com/package/reactive-query-z) ![Downloads](https://img.shields.io/npm/dt/reactive-query-z.svg)\n\n[LIVE EXAMPLE](https://codesandbox.io/p/sandbox/tmxkm5)\n\n**reactive-query-z** is a **lightweight**, reactive data-fetching library for React, built with hooks and TypeScript in mind.\n\n> Minimal API surface, predictable behavior, and production-ready features.\n\n---\n\n## ✨ Why reactive-query-z\n\n* ⚡ Lightweight & hook-based\n* 🔁 REST + GraphQL support\n* ✍️ Full CRUD mutations\n* 💾 Cache with global invalidation\n* 🚀 Optimistic UI updates\n* ♻️ Stale-while-revalidate\n* 📡 Real-time subscriptions (WebSocket / SSE)\n* 🧩 Middleware system (auth, logging, retry, timeout…)\n* 🧠 TypeScript-first API\n\n***Note:*** For full-featured query management, see [*React Query*](https://tanstack.com/query/v4)\n\n---\n\n## 📦 Installation\n\n```bash\nnpm install reactive-query-z\n# or\nyarn add reactive-query-z\n```\n\n---\n\n## 🚀 Basic Usage\n\n### 1️⃣ Querying REST Data\n\n```ts\nimport { useQuery, queryRegistry } from \"reactive-query-z\";\n\ntype User = { id: string; title: string };\n\nfunction UserList() {\n  const {\n    data: users,\n    loading,\n    refetch,\n    error,\n  } = useQuery<User[]>(\"https://jsonplaceholder.typicode.com/posts\", {\n    cacheKey: \"users-list\",\n    // staleTime: 5000,\n    cacheTime: 10000,\n    // autoFetch: true,\n    headers: { \"Content-Type\": \"application/json\" },\n  });\n\n  return (\n    <div>\n      {loading && <p>Loading...</p>}\n      {error && <p>Error: {error.message}</p>}\n\n      <button onClick={() => refetch()}>Refetch</button>\n      <button onClick={() => queryRegistry.invalidate(\"users-list\")}>\n        Invalidate\n      </button>\n\n      <ul>\n        {users?.map((u) => (\n          <li key={u.id}>{u.title}</li>\n        ))}\n      </ul>\n    </div>\n  );\n}\n```\n\n---\n\n### 2️⃣ GraphQL Query\n\n```ts\nimport { useGraphQLQuery } from \"reactive-query-z\";\n\ntype Country = { code: string; name: string; emoji: string };\n\nexport function CountriesList() {\n  const { data, loading, error, refetch } = useGraphQLQuery<{ countries: Country[] }>(\n    \"https://countries.trevorblades.com/\",\n    {\n      query: `\n        query {\n          countries { code name emoji }\n        }\n      `,\n      cacheKey: \"countries\",\n    }\n  );\n\n  if (loading) return <p>Loading...</p>;\n  if (error) return <p>{error.message}</p>;\n\n  return (\n    <ul>\n      <button disabled={loading} onClick={refetch}>Refetch</button>\n      <br />\n      {data?.countries?.map(c => (\n        <li key={c.code}>{c.name} {c.emoji}</li>\n      ))}\n    </ul>\n  );\n}\n```\n\n---\n\n### 3️⃣ Mutations (REST)\n\n```ts\nimport { useMutation, queryRegistry } from \"reactive-query-z\";\n\ntype Post = {\n  userId: number;\n  id: number;\n  title: string;\n  body: string;\n};\n\nexport function AddPost() {\n  const { mutate, loading } = useMutation<Post>(\n    \"https://jsonplaceholder.typicode.com/posts\",\n    {\n      cacheKey: \"posts\",\n      optimisticUpdate: (prev, newPost) => newPost,\n      onSuccess: () => queryRegistry.invalidate(\"posts\"),\n    }\n  );\n\n  const handleAdd = () => {\n    mutate({\n      title: \"New Post\",\n      body: \"This is a new post\",\n      userId: 1,\n    });\n  };\n\n  return (\n    <button onClick={handleAdd} disabled={loading}>\n      {loading ? \"Adding...\" : \"Add Post\"}\n    </button>\n  );\n}\n```\n\n---\n\n### 4️⃣ GraphQL Mutation\n\n```ts\nimport { useGraphQLMutation, queryRegistry } from \"reactive-query-z\";\n\nexport function AddPostGraphQL() {\n  const { mutate, loading } = useGraphQLMutation(\n    \"https://graphqlzero.almansi.me/api\",\n    {\n      mutation: `\n        mutation ($title: String!, $body: String!, $userId: ID!) {\n          createPost(input: { title: $title, body: $body, userId: $userId }) {\n            id\n            title\n            body\n          }\n        }\n      `,\n      variables: { title: \"Hello\", body: \"World\", userId: 122 },\n      onSuccess: () => queryRegistry.invalidate(\"postsGraphQL\"),\n    }\n  );\n\n  return (\n    <button onClick={mutate} disabled={loading}>\n      {loading ? \"Adding...\" : \"Add Post\"}\n    </button>\n  );\n}\n```\n\n---\n\n### 5️⃣ Global Query Invalidation & Global Error Handling\n\n```ts\nimport { queryRegistry, setGlobalErrorHandler } from \"reactive-query-z\";\n\nqueryRegistry.invalidate(\"users\"); // specific\nqueryRegistry.invalidate();        // all queries\n\nsetGlobalErrorHandler((error, info) => {\n  console.error(\"Global fetch error:\", error, info);\n});\n```\n\n---\n\n### 6️⃣ Real-time Subscriptions\n\n```ts\nimport { useHybridQuery } from \"reactive-query-z\";\n\nconst { data } = useHybridQuery(\"/graphql\", {\n  subscriptionUrl: \"ws://localhost:4000\",\n  cacheKey: \"messages\",\n});\n```\n\n---\n\n### 7️⃣ Prefetch & Request Deduplication\n\n#### 🔹 queryClient.fetchQuery\n\n```ts\nimport { queryClient } from \"reactive-query-z\";\n\nawait queryClient.fetchQuery<User[]>(\n  \"https://jsonplaceholder.typicode.com/users\",\n  { cacheKey: \"users\" }\n);\n```\n\n#### 🔹 queryClient.ensureQueryData (recommended)\n\n```ts\nimport { queryClient, useQuery } from \"reactive-query-z\";\n\ntype User = { id: number; name: string };\n\nasync function preloadUsers() {\n  await queryClient.ensureQueryData<User[]>(\n    \"https://jsonplaceholder.typicode.com/users\",\n    { cacheKey: \"users\" }\n  );\n}\n\nfunction Users() {\n  const { data, loading } = useQuery<User[]>(\n    \"https://jsonplaceholder.typicode.com/users\",\n    { cacheKey: \"users\" }\n  );\n\n  if (loading) return <p>Loading...</p>;\n\n  return (\n    <ul>\n      {data?.map((u) => (\n        <li key={u.id}>{u.name}</li>\n      ))}\n    </ul>\n  );\n}\n```\n\n---\n\n## 🔧 API Reference\n\n```ts\nuseQuery\nuseMutation\nuseGraphQLQuery\nuseGraphQLMutation\nuseHybridQuery\n\nqueryClient\nqueryRegistry\n\nprefetchQuery\nprefetchData\nfetchWithRetry\ncommonFetch\nsetGlobalErrorHandler\n```\n\n---\n\n## ⚖️ Comparison with Other Libraries\n\n| Feature                   | reactive-query-z | React Query | SWR  | Apollo Client |\n| ------------------------- | ---------------- | ----------- | ---- | ------------- |\n| REST support              | ✅                | ✅          | ✅   | ⚠️ Partial    |\n| GraphQL support           | ✅                | ⚠️ Plugin   | ❌   | ✅            |\n| Real-time subscription    | ✅                | ⚠️ Plugin   | ❌   | ✅            |\n| Global cache invalidation | ✅                | ✅          | ⚠️   | ✅            |\n| Optimistic updates        | ✅                | ✅          | ⚠️   | ✅            |\n| Stale-while-revalidate    | ✅                | ✅          | ✅   | ✅            |\n| Full CRUD mutations       | ✅                | ✅          | ❌   | ✅            |\n| TypeScript-first          | ✅                | ✅          | ✅   | ✅            |\n| Lightweight               | ✅                | ⚠️          | ✅   | ⚠️            |\n| Subscription built-in     | ✅                | ❌          | ❌   | ✅            |\n\n---\n\n## When to use\n- You want full control over async orchestration\n- You dislike heavy cache lifecycles\n- You prefer explicit invalidation\n\n---\n\n## When NOT to use\n- You need background refetch\n- You need offline persistence\n\n---\n\n## 📜 License\n\nMIT\n","readmeFilename":"README.md"}