#[graphql_handler]Expand description
Attribute macro for GraphQL resolvers with dependency injection support
This macro enables the use of #[inject] parameters in GraphQL resolver functions,
allowing automatic dependency resolution from the InjectionContext.
§Parameters
Regular parameters are passed through as-is. Parameters marked with #[inject]
are automatically resolved from the DI context.
§Requirements
- The function must have an
async_graphql::Context<'_>parameter - The schema must have an
InjectionContextin its data (use.data(injection_ctx)) - All injected types must implement
Injectable - The function must be
async
§Error Handling
If dependency injection fails, the function returns async_graphql::Error
with an error message describing the failure.