Ariadne 0.2.0 replaces GraphQL-Core with GraphQL-core-next that offers much better compliance with GraphQL specification, supports async query execution and resolvers, and improves library's API and developer experience.
- Removed support for Python 3.5 and added support for 3.7.
- Moved to
asyncresolvers, query execution and implements a more recent version of GraphQL spec. If you are updating an existing project, you will need to uninstall
graphql-core-next, as both libraries use
gql()utility that provides GraphQL string validation on declaration time, and enables use of Apollo-GraphQL plugin in Python code.
load_schema_from_path()utility function that loads GraphQL types from a file or directory containing
.graphqlfiles, also performing syntax validation.
start_simple_server()shortcut function for quick dev server creation, abstracting away the
GraphQLMiddleware.make_server()from first time users.
Booleanbuilt-in scalar now checks the type of each serialized value. Returning values of type other than
floatfrom a field resolver will result in a
Boolean cannot represent a non boolean valueerror.
- Redefining type in
type_defswill now result in
TypeErrorbeing raised. This is a breaking change from previous behavior where the old type was simply replaced with a new one.
parse_valuefunction no longer results in GraphQL API producing default error message. Instead,
Nonewill be passed further down to resolver or produce a "value is required" error if its marked as such with
!For old behavior raise either
TypeError. See documentation for more details.
resolversargument defined by
start_simple_server()is now optional, allowing for quick experiments with schema definitions.
dicthas been removed as primitive for mapping python function to fields. Instead,
make_executable_schema()expects object or list of objects with a
bind_to_schemamethod, that is called with a
GraphQLSchemainstance and are expected to add resolvers to schema.
- Default resolvers are no longer set implicitly by
make_executable_schema(). Instead you are expected to include either
ariadne.snake_case_fallback_resolversin the list of
resolversfor your schema.
snake_case_fallback_resolversthat populates schema with default resolvers that map
PascalCasefield names from schema to
snake_casenames in Python.
ResolverMapobject that enables assignment of resolver functions to schema types.
Scalarobject that enables assignment of
parse_literalfunctions to custom scalars.
Scalarare validating if schema defines specified types and/or fields at the moment of creation of executable schema, providing better feedback to the developer.