Creating GraphQL API resolvers in Orionjs
@Resolvers()
decorator along with @Query()
, @Mutation()
, and other decorators make it easy to create type-safe GraphQL APIs with minimal boilerplate.
@Resolvers()
that contains methods decorated with @Query()
or @Mutation()
to define GraphQL operations:
@Query()
decorator with the createQuery()
function to define GraphQL query operations:
@Query()
decorator accepts the following options:
@Mutation()
decorator with the createMutation()
function to define GraphQL mutation operations:
@Mutation()
decorator accepts the same options as @Query()
:
schemaWithName
function:
returns
property of createQuery
or createMutation
:
@UseMiddleware()
decorator:
@Subscriptions()
and @Subscription()
decorators:
@Inject(() => Service)
to access services.
InferSchemaType
.