Skip to main content

Module graphql

Module graphql 

Source
Expand description

Generic GraphQL resolver — mirrors BackboneCrudHandler for the GraphQL transport.

Generated code emits a type alias per entity:

ⓘ
// Generated (was ~300 lines of async-graphql boilerplate):
pub type OrderGraphQLResolver = GenericGraphQLResolver<
    Order, CreateOrderDto, UpdateOrderDto, OrderService
>;

The resolver exposes the standard 11 CRUD operations as GraphQL queries and mutations. Entity-specific computed fields and subscriptions go in the // <<< CUSTOM decorator.

§Note on framework coupling

This module deliberately avoids a hard dependency on async-graphql or any other GraphQL library. The GenericGraphQLResolver is a thin service-holder; concrete GraphQL objects (#[Object] / #[SimpleObject]) are generated at the module level where the GraphQL library is available. This keeps backbone-core dependency-free for GraphQL concerns.

Structs§

GenericGraphQLResolver
Generic GraphQL resolver.
GraphQLListResult
Paginated list result for GraphQL responses.
GraphQLPaginationInput
Standard pagination input shared by all generated GraphQL list queries.

Traits§

GraphQLCapableService
The minimal contract GenericGraphQLResolver needs from a service.