Skip to main content

Ariadne 0.10.0

· One min read

We are happy to announce that Ariadne 0.10 is now available, bringing support for Apollo Federation to the library and adding the ability to send queries to the same channel as the subscription via WebSocket.

Apollo Federation

Ariadne now supports building federated schemas. This means that we can compose many GraphQL services built with Ariadne (or other GraphQL libraries), into a single data graph and use it as if it was implemented as a monolithic service.

from ariadne import QueryType
from ariadne.asgi import GraphQL
from ariadne.contrib.federation import FederatedObjectType, make_federated_schema

type_defs = """
type Query {
me: User
}

type User @key(fields: "email") {
id: ID!
name: String
email: String!
}
"""

query = QueryType()
user = FederatedObjectType("User")


@user.reference_resolver
def resolve_user_reference(_, _info, representation):
return get_user_by_email(representation.get("email"))


schema = make_federated_schema(type_defs, [query, user])
application = GraphQL(schema)

Many thanks to Delyan who contributed this feature. This is another time when community contributes such a large and much-requested feature to Ariadne. Thank you!

CHANGELOG

  • Added support for Apollo Federation.
  • Added the ability to send queries to the same channel as the subscription via WebSocket.