- Fixed
.graphql
definitions files not being included in the dist files
- Added
InputType
for setting Python representations of GraphQL Input types - Added support for passing
Enum
types directly tomake_executable_schema
- Added
convert_names_case
option tomake_federated_schema
. - Added support for the
@interfaceObject
directive in Apollo Federation. - Fixed federation support for directives without surrounding whitespace.
- Fixed type annotations on
EnumType
.
- GraphiQL2 is now default API explorer.
- Added
explorer
option to ASGI and WSGIGraphQL
applications that enables API explorer customization. - Added
ExplorerHttp405
API explorer that returns405 Method Not Allowed
for GET HTTP requests. - Added implementations for GraphiQL2, GraphQL-Playground and Apollo Sandbox explorers.
- Added
convert_names_case
option tomake_executable_schema
to convert all names in schema to Python case using default or custom strategy. - Added support for
Path
-like objects toload_schema_from_path
. - Changed
logger
option to also supportLogger
andLoggerAdapter
instance in addition tostr
with logger name. - Added support for
@tag
directive used by Apollo Federation. - Moved project configuration from
setup.py
topyproject.toml
. - Changed
context_value
option in ASGI and WSGI applications for callables to take query data as second argument. - Changed
root_value
option in ASGI and WSGI applications for callables to take operation and and variables in addition to context and parsed query. - Added
execution_context_class
option to ASGI and WSGI applications. - Added
query_parser
option to ASGI and WSGIGraphQL
applications that enables query parsing customization. - Changed
middleware
option to work with callable or list of middlewares instead ofMiddlewareManager
instance. - Added
middleware_manager_class
option to ASGI and WSGI applications. - Added
handle_request
andhandle_websocket
methods toASGI
application that takes Starlette/FastAPIRequest
andWebsocket
objects. - Fixed type annotations for middlewares.
- Added docstrings to members of public API.
- Fixed an error when schema that defines an interface type with fields having enum arguments with default values (eg.
field(arg: Enum = ENUM_MEMBER)
) is introspected.
- Bumped starlette dependency in setup.py to
<1.0
. - Added Python 3.11 to test matrix.
- Removed usage of deprecated
cgi
module. - Renamed
asgi-file-uploads
optional dependency tofile-uploads
.
- Fixed
GraphQLTransportWSHandler
implementation to handle multiple connections.
- Refactored
ariadne.asgi.GraphQL
to use strategy pattern for handling HTTP and WebSockets. - Updated
load_schema_from_path
to also support.gql
and.graphqls
files. - Added support for
starlette
0.20.
- Fix performance regression in
make_federated_schema
.
- Updated
graphql-core
requirement to 3.2.0. - Bumped
starlette
supported versions to 0.18 and 0.19. - Drop Python 3.6 support.
- Added basic support for
OPTIONS
HTTP request. - Refactor
ariadne.asgi.GraphQL
to make it easier to customize JSON response. - Added
trace_default_resolver
toApolloTracingExtension
that enables tracing for default resolvers. - Fixed
make_federated_schema
error when custom directive in schema has description. - Moved
set_default_enum_values_on_schema
,validate_schema_enum_values
andtype_implements_interface
to public API. - Changed
graphql_sync
to useexecute_sync
instead ofexecute
. - Added
on_operation
hook toariadne.asgi.GraphQL
that's called when individual subscription operation is started. - Added
on_complete
hook toariadne.asgi.GraphQL
that's called when individual subscription operation is completed. - Updated
on_disconnect
hook so its called in Webhook handler'sfinally
clause, making it called in more situations. - Marked
Extension
,ExtensionSync
andSchemaBindable
protocols as@runtime_checkable
. - Renamed
parent
toobj
inApolloTracing
andOpenTracing
extensions so arg name won't cause conflict when custom resolver hasparent
arg.
- Remove
ariadne.contrib.django
from release. - Lock
GraphQL-core
requirement at <3.2.
- Added
on_connect
andon_disconnect
options toariadne.asgi.GraphQL
, enabling developers to run additional initialization and cleanup for websocket connections. - Updated Starlette dependency to 0.17.1.
- Added support for multiple keys for GraphQL federations.
- Made
Query
type optional in federated schemas. - Updated default resolvers to test for
Mapping
instead ofdict
. - Removed
ariadne.contrib.django
. (Use ariadne_django instead). - Updated query cost validator to handle optional variables.
- Updated
graphql-core
requirement to 3.1.3. - Added support for Python 3.9.
- Added support for using nested variables as cost multipliers in the query price validator.
None
is now correctly returned instead of{"__typename": typename}
within federation.- Fixed some surprising behaviors in
convert_kwargs_to_snake_case
andsnake_case_fallback_resolvers
.
- Added
validation_rules
option to query executors as well as ASGI and WSGI apps and Django view that allow developers to include custom query validation logic in their APIs. - Added
introspection
option to ASGI and WSGI apps, allowing developers to disable GraphQL introspection on their server. - Added
validation.cost_validator
query validator that allows developers to limit maximum allowed query cost/complexity. - Removed default literal parser from
ScalarType
because GraphQL already provides one. - Added
extensions
andintrospection
configuration options to Django view. - Updated requirements list to require
graphql-core
3.
- 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 singlerequest
key.
- Added support for
Apollo Federation
. - Added the ability to send queries to the same channel as the subscription via WebSocket.
- Updated
graphql-core-next
tographql-core
3.
- Added recursive loading of GraphQL schema files from provided path.
- Added support for passing multiple bindables as
*args
tomake_executable_schema
. - Updated Starlette dependency to 0.13.
- Made
python-multipart
optional dependency forasgi-file-uploads
. - Added Python 3.8 to officially supported versions.
- Added support for custom schema directives.
- Added support for synchronous extensions and synchronous versions of
ApolloTracing
andOpenTracing
extensions. - Added
context
argument tohas_errors
andformat
hooks.
- 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.
- Added support for file uploads.
- Updated
graphql-core-next
to 1.0.4 which has feature parity with GraphQL.js 14.3.1 and better type annotations. ariadne.asgi.GraphQL
is now an ASGI3 application. ASGI3 is now handled by all ASGI servers.ObjectType.field
andSubscriptionType.source
decorators now raise ValueError when used without name argument (eg.@foo.field
).ScalarType
will now use default literal parser that unpacksast.value
and calls value parser if scalar has value parser set.- Updated
ariadne.asgi.GraphQL
andariadne.wsgi.GraphQL
to support callables forcontext_value
androot_value
options. - Added
logger
option toariadne.asgi.GraphQL
,ariadne.wsgi.GraphQL
andariadne.graphql.*
utils. - Added default logger that logs to
ariadne
. - Added support for
extend type
in schema definitions. - Removed unused
format_errors
utility function and renamedariadne.format_errors
module toariadne.format_error
. - Removed explicit
typing
dependency. - Added
ariadne.contrib.django
package that provides Django class-based view together withDate
andDatetime
scalars. - 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.
- Added
EnumType
type for mapping enum variables to internal representation used in application. - Added support for subscriptions.
- Updated Playground to 1.8.7.
- Split
GraphQLMiddleware
into two classes and moved it toariadne.wsgi
. - Added an ASGI interface based on Starlette under
ariadne.asgi
. - Replaced the simple server utility with Uvicorn.
- Made users responsible for calling
make_executable_schema
. - Added
UnionType
andInterfaceType
types. - Updated library API to be more consistent between types, and work better with code analysis tools like PyLint. Added
QueryType
andMutationType
convenience utils. Suffixed all types names withType
so they are less likely to clash with other libraries built-ins. - Improved error reporting to also include Python exception type, traceback and context in the error JSON. Added
debug
anderror_formatter
options to enable developer customization. - Introduced Ariadne wrappers for
graphql
,graphql_sync
, andsubscribe
to ease integration into custom servers.
- Removed support for Python 3.5 and added support for 3.7.
- Moved to
GraphQL-core-next
that supportsasync
resolvers, query execution and implements a more recent version of GraphQL spec. If you are updating an existing project, you will need to uninstallgraphql-core
before installinggraphql-core-next
, as both libraries usegraphql
namespace. - Added
gql()
utility that provides GraphQL string validation on declaration time, and enables use of Apollo-GraphQL plugin in Python code. - Added
load_schema_from_path()
utility function that loads GraphQL types from a file or directory containing.graphql
files, also performing syntax validation. - Added
start_simple_server()
shortcut function for quick dev server creation, abstracting away theGraphQLMiddleware.make_server()
from first time users. Boolean
built-in scalar now checks the type of each serialized value. Returning values of type other thanbool
,int
orfloat
from a field resolver will result in aBoolean cannot represent a non boolean value
error.- Redefining type in
type_defs
will now result inTypeError
being raised. This is a breaking change from previous behavior where the old type was simply replaced with a new one. - Returning
None
from scalarparse_literal
andparse_value
function no longer results in GraphQL API producing default error message. Instead,None
will be passed further down to resolver or produce a "value is required" error if its marked as such with!
For old behavior raise eitherValueError
orTypeError
. See documentation for more details. resolvers
argument defined byGraphQLMiddleware.__init__()
,GraphQLMiddleware.make_server()
andstart_simple_server()
is now optional, allowing for quick experiments with schema definitions.dict
has been removed as primitive for mapping python function to fields. Instead,make_executable_schema()
expects object or list of objects with abind_to_schema
method, that is called with aGraphQLSchema
instance 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 eitherariadne.fallback_resolvers
orariadne.snake_case_fallback_resolvers
in the list ofresolvers
for your schema. - Added
snake_case_fallback_resolvers
that populates schema with default resolvers that mapCamelCase
andPascalCase
field names from schema tosnake_case
names in Python. - Added
ResolverMap
object that enables assignment of resolver functions to schema types. - Added
Scalar
object that enables assignment ofserialize
,parse_value
andparse_literal
functions to custom scalars. - Both
ResolverMap
andScalar
are validating if schema defines specified types and/or fields at the moment of creation of executable schema, providing better feedback to the developer.