Skip to content
TypeWire

@tahanabavi/typefetch-query-core

v1.1.0

Framework-agnostic query engine for TypeFetch contracts (cache, dedup, staleness, mutations, invalidation).

Writing

A mutation runs the write and then triggers whatever the client declared for it:

ts
const rename = client.watchMutation(api.modules.user.updateUser);
await rename.mutateAsync({ path: { id: "1" }, body: { name: "Ada" } });
// "user.getUser" is invalidated automatically; any watching query refetches.

Because the engine only calls endpoint(input) and reads its id, the same watchMutation drives a typesocket acked event without changing anything:

ts
const send = client.watchMutation(socket.modules.chat.sendMessage);