Ariadne 0.4.0 is now available, and with it bunch of features and improvements for developer experience, and bugfixes!
Our ASGI application has been updated to support version 3 of ASGI protocol, courtesy of Starlette 0.12.
Easier Django integration
We want to make process of starting out with GraphQL in Django easy. In Ariadne 0.3 we've provided example code on our docs that you could've copypasted to your project.
This approach was less than optimal, so in Ariadne 0.4 we are introducing
ariadne.contrib.django package that acts as Django app and provides GraphQL view that you can simply drop in your
from ariadne.contrib.django.views import GraphQLView from django.urls import path from .schema import schema urlpatterns = [ ... path('graphql/', GraphQLView.as_view(schema=schema), name='graphql'), ]
To to sweeten the deal even, we are also providing two scalar implementations:
Datetime. Those two enable developers to exchange dates and datetimes between their UI and Python logic.
Error reporting improvements
In Ariadne 0.3 we've introduced extended error formatting support that added error's backtrace and content to GraphQL response, making it so much easier to get to source of the problem when debugging resolvers.
In 0.4 we are further improving error reporting with introduction of error logging.
Internally Ariadne creates own logger, and then logs all errors and exceptions to it, enabling you to stay on the top of the situation. We've took extra care to make sure that logged errors contain not only information about field in GraphQL query that failed to resolve, but also actual exception data. It also plays good with existing error tracking systems like Sentry:
Keeping you covered
Based on feedback and reports we've received from early adopters we've added bunch of assertions and checks around our API to fail fast and let you spot your errors before your users do.
Also, because in 99% of cases custom scalar literal parser is just a thin wrapper unpacking value from AST
ValueNode and passing for value_parser, Ariadne 0.4 will provide this mechanism for you out of the box. If you still need custom literal handling logic - you can still do it.
Above were only the highlights of this release. Here's complete changelog for those interested in nitty-gritty details:
graphql-core-nextto 1.0.4 which has feature parity with GraphQL.js 14.3.1 and better type annotations.
ariadne.asgi.GraphQLis now an ASGI3 application. ASGI3 is now handled by all ASGI servers.
SubscriptionType.sourcedecorators now raise ValueError when used without name argument (eg.
ScalarTypewill now use default literal parser that unpacks
ast.valueand calls value parser if scalar has value parser set.
ariadne.wsgi.GraphQLto support callables for
- Added default logger that logs to
- Added support for
extend typein schema definitions.
- Removed unused
format_errorsutility function and renamed
- Removed explicit
ariadne.contrib.djangopackage that provides Django class-based view together with
- Fixed default ENUM values not being set.
- Updated project setup so mypy ran in projects with Ariadne dependency run type checks against it's annotations.
- Updated Starlette to 0.12.0.