minos.plugins.graphql.builders.schema

Classes

GraphQLSchemaBuilder

GraphQL Schema Builder class.

class GraphQLSchemaBuilder[source]

Bases: object

GraphQL Schema Builder class.

__init__(*args, **kwargs)[source]
classmethod build(routes)[source]

Build a new schema from routes.

Parameters

routes (dict[minos.plugins.graphql.decorators.GraphQlEnrouteDecorator, collections.abc.Callable]) – The routes to build the schema.

Returns

A GraphQLSchema instance.

Return type

GraphQLSchema

static adapt_callback(callback)[source]

Adapt a callback from framework’s Request-Response to GraphQl structure.

Parameters

callback (Callable[[Request], Union[Response, None, Awaitable[Optional[Response]]]]) – The callback to be adapted.

Returns

The adapted callback.

Return type

Callable[[Any, Any, Any], Awaitable[Any]]