nano-kit-query
Installation
SKILL.md
@nano_kit/query
@nano_kit/query is the data layer on top of @nano_kit/store: cached, deduplicated queries bound to reactive parameters, mutations, operations, infinite queries and SSR hydration of the cache. Signals, effects, stores and DI are described in the nano-kit-store skill.
Reference
DOCS.md next to this file is the documentation of the released package as published on https://nano-kit.js.org, generated from the site sources. Read its relevant sections for exact signatures, settings and examples before writing code. This skill adds only conventions, choices and pitfalls.
Which primitive for which job
query: data that depends on reactive parameters and should load whenever something shows it. It fetches only while its data signal is observed, refetches on parameter changes, revalidation and invalidation, and never at creation time.mutation: a write on demand with the last result, error and loading state.operation: manual work whose result deserves the cache (AI generation, reports, explicit search submits, lazy loading that must not start on mount).infinite: pages behind a cursor; a parameter change restarts from the first page.- Create the client once per app as an injectable
Client$()factory with the extensions the app needs (mutations(),infinites(),operations()) andhydratable()when the app renders on the server.