Ariadne 0.6.0
Ariadne 0.6 is now available, bringing bug fixes, extensions and support for application performance monitoring.
Extensions and middlewares
Extensions support is now available. Extensions can be used to add custom monitoring to the API, as well as inject custom logic into query execution process.
0.6 also formalizes our support for the GraphQL middlewares, which enable developers to wrap resolvers used by server with custom logic.
Extensions are only available in GraphQL servers running over the ASGI, but middlewares are supported by both ASGI and WSGI servers.
Apollo tracing and OpenTracing monitoring extensions.
ariadne.contrib.tracing
package has been added to the library that provides extensions for easy enabling application performance metrics in GraphQL Server.
Apollo tracing extension adds query's trace data to the results JSON. This data can then be viewed using the TRACE
option in GraphQL Playground.
OpenTracing extension can be used to monitor GraphQL API for performance and errors using popular APM tools like Jaeger or Datadog:
CHANGELOG
- Updated
graphql-core-next
to 1.1.1 which has feature parity with GraphQL.js 14.4.0. - Added basic extensions system to the
ariadne.graphql.graphql
. Currently only available in theariadne.asgi.GraphQL
app. - Added
convert_kwargs_to_snake_case
utility decorator that recursively converts the case of arguments passed to resolver fromcamelCase
tosnake_case
. - Removed
default_resolver
and replaced its uses in library withgraphql.default_field_resolver
. - Resolver returned by
resolve_to
util followsgraphql.default_field_resolver
behaviour and supports resolving to callables. - Added
is_default_resolver
utility for checking if resolver function isgraphql.default_field_resolver
, resolver created withresolve_to
oralias
. - Added
ariadne.contrib.tracing
package withApolloTracingExtension
andOpenTracingExtension
GraphQL extensions for adding Apollo tracing and OpenTracing monitoring to the API (ASGI only). - Updated ASGI app disconnection handler to also check client connection state.
- Fixed ASGI app
context_value
option support for async callables. - Updated
middleware
option implementation in ASGI and WSGI apps to accept list of middleware functions or callable returning those. - Moved error formatting utils (
get_formatted_error_context
,get_formatted_error_traceback
,unwrap_graphql_error
) to public API.