Reading
// Imperative: fetch (dedups an in-flight request for the same key), or read the
// cache without triggering one.
await client.prefetchQuery(api.modules.user.getUser, { path: { id: '1' } })
const user = client.getQueryData(api.modules.user.getUser, {
path: { id: '1' },
})
// Reactive: an observer is what an adapter wraps — subscribe + getSnapshot.
const observer = client.watchQuery(api.modules.user.getUser, {
path: { id: '1' },
})
const unsubscribe = observer.subscribe(() => render(observer.getSnapshot()))Two arguments — endpoint and input — no query key, no query function.