Skip to content
TypeWire

@tahanabavi/typewire-nestjs

documents v0.1.1

NestJS integration for the TypeWire ecosystem — serve one set of Zod contracts over every wire your client speaks: REST/HTTP, gRPC (Connect JSON), GraphQL and typesocket WebSocket gateways, with request/response validation on all of them.

Error shapes (RichError-compatible)

Request validation failure → 400 with all part issues collected:

json
{
"statusCode": 400,
"message": "Request validation failed",
"code": "VALIDATION_ERROR",
"errors": {
"path.id": ["Too small: expected string to have >=1 characters"],
"body.name": ["Too small: expected string to have >=2 characters"]
}
}

On the frontend, RichError picks up message, code, and errors automatically — field errors from the backend arrive typed and addressable.

Response contract violation → 500 with code: "RESPONSE_CONTRACT_VIOLATION". Issues are always logged server-side; include them in the body during development with exposeResponseErrors: true.