Skip to main content

Decorators Reference

@Procedures()

Marks a class as a tRPC procedures container. This decorator also applies @Service() for dependency injection.

@TQuery()

Marks a field as a tRPC query procedure.

@TMutation()

Marks a field as a tRPC mutation procedure.

Procedure Options

Both createTQuery and createTMutation accept the same options:

Schema Types

You can use Orionjs schema definitions:

Merging Procedures

When using the component system, procedures are merged automatically via mergeComponents(). For standalone usage, you can use mergeProcedures to combine multiple procedure classes while preserving types:

Context and Viewer

The tRPC context includes the Orionjs viewer:

Error Handling

Throw errors normally - they’ll be properly serialized by tRPC: