pypi / graphql-core
graphql-core
What changed in graphql-core 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.
26 breaking4 security2 deprecations25 new APIs and options9 performance5 behavior and defaults44 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initgraphql-core 3115 changes
Breaking changes 26
Empty selection sets are now allowed by default, and this parse and validate option is deprecated; subscriptions selecting no field are rejected.
Only CRLF, LF, and CR count as line breaks in source locations and block strings, changing error locations at line starts.
Exhausting the budget now stops the whole validation with errors found so far and "Validation aborted."; the default is 500,000 units and return type wrapper comparisons count.
Validation stops with "Validation aborted." when work on shared fragments exceeds 50,000 units.
With experimental @stream, using it on either of two fields with the same response name now causes a conflict, even when directives are identical.
A GraphQLError created while handling an exception no longer adopts that exception's traceback; when raised, it gets its own traceback and the handled exception as context.
validation_aborted_error has been removed from graphql.validation.validate.
AST collection fields are tuples instead of lists.
AST nodes are frozen dataclasses, and all AST collection fields are tuples instead of lists.
create_source_event_stream() now takes a built Executor instead of the request arguments.
Functions and options deprecated in GraphQL.js 16 have been removed.
ExecutionContext has been renamed to Executor.
The execution_context_class parameter has been renamed to executor_class.
The parser option has been removed because directives on directive definitions and extensions are now part of the language.
A Python int that cannot be represented exactly as a float now raises a GraphQLError when coerced to Float.
Input coercion follows the specification more strictly, and default values are validated against their types.
GraphQL-core 3.3.0 supports Python 3.10 to 3.15; Python 3.7 to 3.9 are no longer supported.
Schema validation rejects input objects that cannot be given a finite value and reports circular input object references.
subscribe() stays synchronous when possible, like execute(), and raises a GraphQLError for non-subscription operations.
Non-integer numbers such as Decimal("2.5") produce a field error when serialized as Int instead of being truncated; non-number objects convertible to int still work.
When the overlapping-fields budget is exhausted, validation stops and returns errors found so far plus "Validation aborted."; MAX_FIELD_COMPARISONS is deprecated.
Documents, fragment chains, and variable values nested deeper than 200 levels are rejected with GraphQL errors instead of raising RecursionError in the request path.
Now subclasses GraphQLError, and validate() returns it as the last error when validation aborts, including on the error limit.
The parser's token limit now counts every consumed token, including skipped comments, so comment-padded documents can no longer bypass the limit.
The token_count of a parsed document now includes comments.
Directive locations are now required to be non-empty.
Security 4
Documents, fragment chains, and variable values nested deeper than 200 levels are rejected with GraphQL errors instead of raising RecursionError in the request path.
The token limit is now enforced while comments are skipped, rather than only after a whole run of comments has been read.
Each validation aborted after exceeding max_errors now creates a new error, preventing traceback growth and a memory-exhaustion denial of service.
Validation enforces a per-document field-comparison budget and aborts with a GraphQLError when exhausted. The default is 250,000 comparisons and can be adjusted by assigning to this constant.
Deprecations 2
Deprecated in favor of MAX_COMPLEXITY_BUDGET; changing it sets the budget to twice its value and issues a DeprecationWarning.
Deprecated in favor of the new parser limits without a warning; it is not an alias, continues counting comments, and is now accepted by build_schema.
New APIs and options 25
New parser option available to parse functions, build_schema, graphql, and graphql_sync.
New print_ast option that stops indentation and newline insertion at the specified depth; block strings retain their newlines.
New parser option for parse functions, build_schema, graphql, and graphql_sync; it works as in GraphQL.js and does not count comments.
New parser option available to parse functions, build_schema, graphql, and graphql_sync; its limit is measured in code points.
Aborting an operation raises this error with the partial result.
Operations can be aborted with an AbortSignal.
Directives on directive definitions and directive extensions are now part of the language.
Executors support hooks.
Adds incremental delivery with @defer and @stream, following the current spec proposal.
Adds experimental fragment arguments through a parser option.
This new function reports safe changes in addition to breaking and dangerous changes.
Use this new method to get the enclosing scalar inside list literals in custom scalar positions.
Bounds all work of OverlappingFieldsCanBeMergedRule, including return type wrapper comparisons, with a default budget of 500,000 units.
Adds an option to graphql, validate, execute, subscribe, and related functions that removes "Did you mean" from validation and input coercion errors.
Adds a parser option limiting comments for all parse functions and build_schema.
Adds a parser limit for lexical tokens to all parse functions and build_schema; it does not count comments.
Directive definitions can now have directives applied to them.
The introspection depth for ofType can now be configured.
Executable definitions, including variable definitions, can now have descriptions.
Adds the max_coercion_errors option.
Adds support for parsing and resolving schema coordinates.
Exposes token_count on DocumentNode.
Values can now be passed to GraphQLEnumType as a thunk.
OneOf Input Objects are implemented via the @oneOf directive.
Recommended validation rules are introduced.
Performance 9
Execution of fields without arguments is faster.
Its complexity budget now covers all rule work, addressing documents that could still take quadratic time.
Printing is 27 to 33 percent faster on CPython on normal documents and 20 to 29 percent faster on PyPy on small documents; deeply nested values no longer grow cubically in time.
Fields repeated in a selection set validate much faster, and errors with many locations no longer scan the source for each location.
Recreating schemas is faster, by about 23 percent on CPython.
SDL validation is faster.
A cheaper visit() makes validation 10 to 16 percent faster on CPython.
Coercing literal arguments is faster.
Printing is 57 to 62 percent faster on CPython on normal documents and 22 to 42 percent faster on PyPy.
Behavior and default changes 5
Conflict descriptions are abbreviated after 1000 characters, each side keeps at most 20 locations, and fragment spreads with large arguments use a shortened description.
Merging fragments with arguments is stricter when this experimental feature is enabled.
Reports errors when entering an operation or fragment, which can change error order.
Returns None inside list literals in custom scalar positions; use get_parent_input_type() for the enclosing scalar.
GraphQL-core 3 officially supports Python 3.8.
Fixes and other changes 44
With @defer and @stream, shared data is no longer lost when another owning fragment fails or delayed until a slower fragment finishes; nested failures are announced and completed once.
With @defer, a second labelled defer of the same fragment is retained, and a non-deferred spread is no longer skipped after a deferred parent.
Without check_sync, objects that are both iterable and async iterable are iterated synchronously instead of returning a coroutine in data.
Objects implementing __index__ can again be serialized as Float.
Conflicts between equal selection sets of fragments on different types are detected in documents parsed with no_location=True.
Objects implementing __index__ can again be serialized as Int.
Skips fragments already checked at the same or greater depth, preventing repeated walks and avoiding RecursionError for long fragment chains under an introspection field.
A nullable variable used inside a fragment on a non-null argument with a default is accepted again.
Formats block strings containing special characters or trailing newlines like GraphQL.js.
No longer misplaces the caret in minified documents at chunk boundaries or at the end of the document.
No longer raises IndexError for sources containing characters such as VT, FF, NEL, or U+2028.
Subfield memoization no longer risks reusing freed object ids, preventing a field from being resolved with another field's selection set.
Coerced defaults are memoized on each argument or input field, so shared default values are coerced for the correct type.
Decimal, Fraction, and NumPy scalar values can again be serialized as Int, Float, and Boolean; non-integer values are rejected as Int rather than truncated.
This release supports Python 3.10 to 3.15.
Closing a subscription now closes the source iterator even when __aiter__ returns a different object.
An explicit Undefined variable value is treated as omitted, so the variable's default applies.
Returns None inside list literals in custom scalar positions; use get_parent_input_type() for the enclosing scalar.
No longer leaves is_type_of coroutines unawaited when a later is_type_of raises.
Error messages now use at most 100 levels of indentation.
Keeps the original error if closing a source without athrow also fails.
The nesting limit helps prevent stack exhaustion from crashing the interpreter on PyPy; deep recursion elsewhere can still encounter the issue.
This patch release supports Python 3.7 to 3.15.
The error message now correctly says "abstract type" instead of "composite type".
On Python 3.14, graphql_sync() and execute_sync() now report that execution failed to complete synchronously when called outside a running event loop.
Truncated string escape sequences now produce a GraphQLSyntaxError instead of an unhandled IndexError from parse() or graphql_sync().
Type hints now use uppercase values for the kind of types returned by introspection.
Python 3.15 is now supported.
Variable own-property checks are restored when converting values from an AST.
Unhandled exceptions during abstract type resolution are caught.
Sibling errors are no longer added after null propagation has occurred.
Validates that nullable variables are not passed to oneOf input object fields, as required by the spec.
Removes erroneous oneOf validation from the “values of correct type” rule.
Fixes incorrect validation errors when variable descriptions are used.
Fixes handling of empty selection sets.
Corrects the typing of extensions in GraphQLFormattedError.
Adds kind to the introspection query, mutation, and subscription root types.
Fixes missed field-merge conflicts hidden behind nested fragments.
Preserves schema and input-field properties, such as descriptions, when sorting.
introspection.TypeResolvers is available again as an alias for TypeFields, preserving backward compatibility.
Issues with pickled schemas are solved.
This patch release supports Python 3.7 to 3.14.
Sorting schemas now keeps extensions.
Fixes possible sort errors in build_response().