Handbook - Architecture - Extension boundaries
Public API clients
Extend CloudGrid clients without bypassing the BFF or public contracts.
On this page
On this page
Public API clients are convenience wrappers around CloudGrid’s public GraphQL contract. They must not become a second product API or a shortcut around the TypeScript BFF.
Boundary
A client may:
- call the public
/graphqlendpoint; - use generated types from
apps/packages/ui-contracts; - expose ergonomic operation helpers for documented GraphQL queries, mutations, and subscriptions;
- map public GraphQL problem errors into client-language exceptions.
A client must not:
- connect to NATS, SurrealDB, storage-read, storage-write, or control-plane directly;
- add REST telemetry read endpoints;
- filter, aggregate, correlate, rank, or enrich telemetry beyond local presentation state;
- invent fields that are not in
specs/03-contracts/graphql/public-schema.graphql.
Extension path
- Add or change the GraphQL SDL first when the public surface needs new behavior.
- Regenerate or update UI contract types.
- Implement the BFF resolver as a validation and bridge-forwarding layer.
- Add the client helper after the public operation exists.
- Verify with
bun run contracts:checkplus focused client tests.
Telemetry query semantics still belong to storage-read. A client helper can make an operation easier to call, but it cannot define new filtering, sorting, cursor, grouping, or aggregation behavior.
Last updated .