Skip to main content

Ariadne 0.11.0

· 3 min read

No joke, today we are releasing Ariadne 0.11!

Ariadne 0.11 is an maintenance release focused on resolving few small but annoying issues reported by the community.

Removed support for sending queries and mutations via WebSocket

Few weeks back we've merged to Ariadne a change that enabled execution of GraphQL queries and mutations over the websocket connection - a feature implemented by some GraphQL client libraries such as apollo-link-ws.

Only after release we have learned that logic testing if incoming GraphQL operation is subscription or not is incorrect, classifying correct subscription payloads sent by clients as queries, making it impossible to implement subscriptions in Ariadne 0.10.

We have decided to roll-back the change in 0.11, to make sure that subscriptions are still available to users that rely on them.

We have also added the feature to our roadmap - contributions are welcome!

Unified default info.context value for WSGI to be dict with single request key

The type of default value of info.context differed between ariadne.wsgi and ariadne.asgi.

While in ASGI it was a dict with single key request containing instance of current HTTP request, it in WSGI it was a dict containing HTTP request data as its attributes.

Code examples in documentation assumed info.context["request"] as means for accessing current HTTP request from resolver, which was source of confusion for those using Ariadne with WSGI.

Starting with Ariadne 0.11, the default context value passed to resolvers is also dict with single key: request. This key's value is a dict containing current HTTP's request data as described by WSGI specification.

If you've haven't customized the context_value option of your GraphQL application and your resolvers rely on info.context, this is a breaking change. You will have to update your resolvers to use info.context["request"] for request data, or provide custom context_value function returning context in old shape:

app = GraphQL(
schema,
type_defs,
context_value=lambda environ: environ
)

Note: This change applies only to GraphQL class importable directly from ariadne.wsgi module. If you are using Ariadne with ariadne.contrib.django, info.context will remain django.http.HTTPRequest instance.

CHANGELOG

  • Fixed convert_kwargs_to_snake_case utility so it also converts the case in lists items.
  • Removed support for sending queries and mutations via WebSocket.
  • Freezed graphql-core dependency at version 3.0.3.
  • Unified default info.context value for WSGI to be dict with single request key.