createClientModule<Defined in: packages/modelence/src/client/module.ts:88 Creates a typed client accessor for a module’s public configs, queries, and mutations. UseTModule>(moduleName):object
import type to reference the module so no server code is bundled on the client.
Arg and return types for queries and mutations are inferred automatically from the
server-side handler signatures.
Example
Type Parameters
| Type Parameter |
|---|
TModule extends AnyModule |
Parameters
| Parameter | Type | Description |
|---|---|---|
moduleName | string | The module’s name as passed to new Module(name, ...). |
Returns
| Name | Type | Description | Defined in |
|---|---|---|---|
getConfig() | (key) => undefined | PublicKeyOf<TModule["configSchema"]>[K] | - | packages/modelence/src/client/module.ts:90 |
infiniteQuery() | (name, getArgs) => object | Returns options for useInfiniteQuery. The getArgs callback receives the current pageParam and returns the args to pass to the query handler. Spread the result into useInfiniteQuery alongside getNextPageParam. Annotate the pageParam type in the callback so TypeScript can infer the page param type — no manual generic needed on useInfiniteQuery. | packages/modelence/src/client/module.ts:134 |
mutation() | (name) => object | - | packages/modelence/src/client/module.ts:114 |
query() | (name, …rest) => object | - | packages/modelence/src/client/module.ts:97 |