API FEATURE
GraphQL API
If your public API is GraphQL-first, Semitexa still keeps the application layer explicit and typed.
Feature Guide
A quick orientation block that answers the essential questions: what this feature does, how it works, why it matters, and the key concepts behind it.
What this does
Semitexa can also serve GraphQL-first APIs. The public entrypoint is still POST /graphql, but the use case behind each field remains explicit through payload and output contracts.
How it works
A GraphQL-first operation declares #[ExposeAsGraphql(...)] on a dedicated payload and returns a typed output DTO. The transport may be GraphQL-only, but the application structure still avoids the usual resolver sprawl of ad-hoc field classes and improvised arrays.
Why it matters
This keeps GraphQL honest. Teams get the graph they want without paying for a second hidden application layer made of resolver glue.
Key concepts
- POST /graphql
- The public transport endpoint used by GraphQL clients.
- GraphQL-first
- A use case that is exposed only through the graph and does not need a public REST route.
- typed output DTO
- A concrete class that owns the public GraphQL response shape.
GraphQL API
GraphQL-first without resolver sprawl
The public entrypoint is POST /graphql. The important part is that Semitexa still keeps the use case explicit: one payload, one output contract, one graph field.
POST /graphql
query.productMetrics
ProductMetricsGraphqlView
Example query
query {
productMetrics {
total
active
archived
averagePrice
}
}
Example response
{
"data": {
"productMetrics": {
"total": 128,
"active": 117,
"archived": 11,
"averagePrice": 189.4
}
}
}
Verified against Semitexa Ultimate 2026.09.19.1020
GraphQL API
If your public API is GraphQL-first, Semitexa still keeps the application layer explicit and typed.
How it works
A GraphQL-only endpoint uses #[ExposeAsGraphql] on the Payload DTO to register the operation into the GraphQL schema under a declared field name and root type (Query or Mutation). The handler returns a typed output DTO — a plain PHP class — and the framework serializes it into the GraphQL response shape. No resolver classes, no schema-first string parsing, no separate type registry to maintain.
Why this matters
GraphQL-first Semitexa APIs still use typed payloads and typed output DTOs. The application logic lives in the handler, which keeps business code away from transport concerns. Adding a new GraphQL field means adding one Payload DTO with the attribute — the schema updates automatically on the next boot.
How it works
A GraphQL-first operation declares #[ExposeAsGraphql(...)] on a dedicated payload and returns a typed output DTO. The transport may be GraphQL-only, but the application structure still avoids the usual resolver sprawl of ad-hoc field classes and improvised arrays.
Why it matters
This keeps GraphQL honest. Teams get the graph they want without paying for a second hidden application layer made of resolver glue.
Key concepts
- POST /graphql
- The public transport endpoint used by GraphQL clients.
- GraphQL-first
- A use case that is exposed only through the graph and does not need a public REST route.
- typed output DTO
- A concrete class that owns the public GraphQL response shape.