Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-graphql-core for openSUSE:Factory checked in at 2025-02-04 18:14:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-graphql-core (Old) and /work/SRC/openSUSE:Factory/.python-graphql-core.new.2316 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-graphql-core" Tue Feb 4 18:14:14 2025 rev:8 rq:1243133 version:3.2.6 Changes: -------- --- /work/SRC/openSUSE:Factory/python-graphql-core/python-graphql-core.changes 2024-11-13 15:30:12.362086187 +0100 +++ /work/SRC/openSUSE:Factory/.python-graphql-core.new.2316/python-graphql-core.changes 2025-02-04 18:15:14.650249121 +0100 @@ -1,0 +2,17 @@ +Tue Feb 4 11:15:23 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaub...@suse.com> + +- Update to 3.2.6 + * Alpha release GraphQL-core v3.3.0a7, based on GraphQL.js v17.0.0a3. + * Notable improvements since the last alpha release: + + This release also supports Python 3.13 + + New incremental response format using id and subPath and pending notifications + + OneOf Input Objects via @oneOf directive + + Speedup sorting and building/extending schema + + Support for fourfold nested lists in introspection + + Transform input objects used as default values (#206) + + Support deep copy of schema with directive with arg of custom type (#210) + + Allow injecting custom data to custom execution context (#226) + + ValidationAbortedError can now be imported (#227) + + Benchmarking with CodSpeed (#230) + +------------------------------------------------------------------- Old: ---- graphql_core-3.2.5.tar.gz New: ---- graphql_core-3.2.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-graphql-core.spec ++++++ --- /var/tmp/diff_new_pack.Ref373/_old 2025-02-04 18:15:15.118268430 +0100 +++ /var/tmp/diff_new_pack.Ref373/_new 2025-02-04 18:15:15.122268595 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-graphql-core # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,19 +16,19 @@ # -%define skip_python2 1 %{?sle15_python_module_pythons} Name: python-graphql-core -Version: 3.2.5 +Version: 3.2.6 Release: 0 Summary: GraphQL implementation for Python License: MIT Group: Development/Languages/Python URL: https://github.com/graphql-python/graphql-core Source: https://files.pythonhosted.org/packages/source/g/graphql_core/graphql_core-%{version}.tar.gz +BuildRequires: %{python_module pip} +BuildRequires: %{python_module poetry-core} BuildRequires: %{python_module pytest-asyncio >= 0.14} BuildRequires: %{python_module pytest-benchmark >= 3.2} -BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Conflicts: python-graphql @@ -43,10 +43,10 @@ %setup -q -n graphql_core-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -55,5 +55,6 @@ %files %{python_files} %doc README.md %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/graphql +%{python_sitelib}/graphql_core-%{version}*info ++++++ graphql_core-3.2.5.tar.gz -> graphql_core-3.2.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/.bumpversion.cfg new/graphql_core-3.2.6/.bumpversion.cfg --- old/graphql_core-3.2.5/.bumpversion.cfg 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/.bumpversion.cfg 2025-01-26 17:36:15.000000000 +0100 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.2.5 +current_version = 3.2.6 commit = False tag = False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/PKG-INFO new/graphql_core-3.2.6/PKG-INFO --- old/graphql_core-3.2.5/PKG-INFO 2024-10-13 20:24:27.606250800 +0200 +++ new/graphql_core-3.2.6/PKG-INFO 2025-01-26 17:36:18.159942000 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.2 Name: graphql-core -Version: 3.2.5 +Version: 3.2.6 Summary: GraphQL implementation for Python, a port of GraphQL.js, the JavaScript reference implementation for GraphQL. Home-page: https://github.com/graphql-python/graphql-core Author: Christoph Zwerschke @@ -25,6 +25,17 @@ Description-Content-Type: text/markdown License-File: LICENSE Requires-Dist: typing-extensions<5,>=4; python_version < "3.10" +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: description-content-type +Dynamic: home-page +Dynamic: keywords +Dynamic: license +Dynamic: requires-dist +Dynamic: requires-python +Dynamic: summary # GraphQL-core 3 @@ -38,13 +49,18 @@  [](https://github.com/ambv/black) -The current version 3.2.5 of GraphQL-core is up-to-date with GraphQL.js version 16.8.2. +The current version 3.2.6 of GraphQL-core is up-to-date with GraphQL.js version 16.8.2. -An extensive test suite with over 2300 unit tests and 100% coverage comprises a +An extensive test suite with over 2500 unit tests and 100% coverage comprises a replication of the complete test suite of GraphQL.js, making sure this port is reliable and compatible with GraphQL.js. -Note that for various reasons, GraphQL-core does not use SemVer like GraphQL.js. Increases in the major version of GraphQL.js are reflected in the minor version of GraphQL-core instead. This means there can be breaking changes in the API when the minor version changes, and only patch releases are fully backward compatible. Therefore, we recommend something like `=~ 3.2.0` as version specifier when including GraphQL-core as a dependency. +Note that for various reasons, GraphQL-core does not use SemVer like GraphQL.js. +Changes in the major version of GraphQL.js are reflected in the minor version of +GraphQL-core instead. This means there can be breaking changes in the API +when the minor version changes, and only patch releases are fully backward compatible. +Therefore, we recommend using something like `~= 3.2.0` as the version specifier +when including GraphQL-core as a dependency. ## Documentation @@ -76,8 +92,8 @@ python -m pip install graphql-core -You can also use [poetry](https://github.com/python-poetry/poetry) for installation in a -virtual environment: +You can also use [poetry](https://github.com/python-poetry/poetry) for installation +in a virtual environment: poetry install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/README.md new/graphql_core-3.2.6/README.md --- old/graphql_core-3.2.5/README.md 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/README.md 2025-01-26 17:36:15.000000000 +0100 @@ -10,13 +10,18 @@  [](https://github.com/ambv/black) -The current version 3.2.5 of GraphQL-core is up-to-date with GraphQL.js version 16.8.2. +The current version 3.2.6 of GraphQL-core is up-to-date with GraphQL.js version 16.8.2. -An extensive test suite with over 2300 unit tests and 100% coverage comprises a +An extensive test suite with over 2500 unit tests and 100% coverage comprises a replication of the complete test suite of GraphQL.js, making sure this port is reliable and compatible with GraphQL.js. -Note that for various reasons, GraphQL-core does not use SemVer like GraphQL.js. Increases in the major version of GraphQL.js are reflected in the minor version of GraphQL-core instead. This means there can be breaking changes in the API when the minor version changes, and only patch releases are fully backward compatible. Therefore, we recommend something like `=~ 3.2.0` as version specifier when including GraphQL-core as a dependency. +Note that for various reasons, GraphQL-core does not use SemVer like GraphQL.js. +Changes in the major version of GraphQL.js are reflected in the minor version of +GraphQL-core instead. This means there can be breaking changes in the API +when the minor version changes, and only patch releases are fully backward compatible. +Therefore, we recommend using something like `~= 3.2.0` as the version specifier +when including GraphQL-core as a dependency. ## Documentation @@ -48,8 +53,8 @@ python -m pip install graphql-core -You can also use [poetry](https://github.com/python-poetry/poetry) for installation in a -virtual environment: +You can also use [poetry](https://github.com/python-poetry/poetry) for installation +in a virtual environment: poetry install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/docs/conf.py new/graphql_core-3.2.6/docs/conf.py --- old/graphql_core-3.2.5/docs/conf.py 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/docs/conf.py 2025-01-26 17:36:15.000000000 +0100 @@ -51,7 +51,7 @@ # General information about the project. project = "GraphQL-core 3" -copyright = "2024, Christoph Zwerschke" +copyright = "2025, Christoph Zwerschke" author = "Christoph Zwerschke" # The version info for the project you're documenting, acts as replacement for @@ -61,7 +61,7 @@ # The short X.Y version. # version = '3.2' # The full version, including alpha/beta/rc tags. -version = release = "3.2.5" +version = release = "3.2.6" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/poetry.lock new/graphql_core-3.2.6/poetry.lock --- old/graphql_core-3.2.5/poetry.lock 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/poetry.lock 2025-01-26 17:36:15.000000000 +0100 @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. [[package]] name = "typing-extensions" @@ -14,4 +14,4 @@ [metadata] lock-version = "2.0" python-versions = "^3.6" -content-hash = "b8109651bbaf9410f0f7414200846c7a806e72dc7c5ab3c1698348b12f6d252a" +content-hash = "101c4a8c58c012e2a35491927fc7f20dd2ec86a7d7297998be0bf6c4b12204af" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/pyproject.toml new/graphql_core-3.2.6/pyproject.toml --- old/graphql_core-3.2.5/pyproject.toml 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/pyproject.toml 2025-01-26 17:36:15.000000000 +0100 @@ -1,6 +1,6 @@ [tool.poetry] name = "graphql-core" -version = "3.2.5" +version = "3.2.6" description = """ GraphQL-core is a Python port of GraphQL.js,\ the JavaScript reference implementation for GraphQL.""" @@ -49,11 +49,11 @@ [tool.poetry.dependencies] python = "^3.6" typing-extensions = [ - { version = ">=4,<5", python = "<3.10" } + { version = ">=4.1,<5", python = "<3.10" } ] [tool.black] -target-version = ['py36', 'py37', 'py38', 'py39', 'py310', 'py311', 'py312'] +target-version = ['py36', 'py37', 'py38', 'py39', 'py310', 'py311', 'py312', 'py313'] [tool.pyright] reportIncompatibleVariableOverride = false @@ -77,5 +77,5 @@ ] [build-system] -requires = ["poetry_core>=1,<2", "setuptools>=59,<70"] +requires = ["poetry_core>=1,<3", "setuptools>=59,<76"] build-backend = "poetry.core.masonry.api" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/src/graphql/execution/values.py new/graphql_core-3.2.6/src/graphql/execution/values.py --- old/graphql_core-3.2.5/src/graphql/execution/values.py 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/src/graphql/execution/values.py 2025-01-26 17:36:15.000000000 +0100 @@ -23,6 +23,7 @@ GraphQLField, GraphQLInputType, GraphQLSchema, + is_input_object_type, is_input_type, is_non_null_type, ) @@ -160,8 +161,13 @@ argument_node = arg_node_map.get(name) if argument_node is None: - if arg_def.default_value is not Undefined: - coerced_values[arg_def.out_name or name] = arg_def.default_value + value = arg_def.default_value + if value is not Undefined: + if is_input_object_type(arg_def.type): + # coerce input value so that out_names are used + value = coerce_input_value(value, arg_def.type) + + coerced_values[arg_def.out_name or name] = value elif is_non_null_type(arg_type): # pragma: no cover else raise GraphQLError( f"Argument '{name}' of required type '{arg_type}'" @@ -176,8 +182,12 @@ if isinstance(value_node, VariableNode): variable_name = value_node.name.value if variable_values is None or variable_name not in variable_values: - if arg_def.default_value is not Undefined: - coerced_values[arg_def.out_name or name] = arg_def.default_value + value = arg_def.default_value + if value is not Undefined: + if is_input_object_type(arg_def.type): + # coerce input value so that out_names are used + value = coerce_input_value(value, arg_def.type) + coerced_values[arg_def.out_name or name] = value elif is_non_null_type(arg_type): # pragma: no cover else raise GraphQLError( f"Argument '{name}' of required type '{arg_type}'" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/src/graphql/language/parser.py new/graphql_core-3.2.6/src/graphql/language/parser.py --- old/graphql_core-3.2.5/src/graphql/language/parser.py 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/src/graphql/language/parser.py 2025-01-26 17:36:15.000000000 +0100 @@ -1,6 +1,7 @@ -from typing import Callable, Dict, List, Optional, Union, TypeVar, cast from functools import partial +from typing import Callable, Dict, List, Optional, TypeVar, Union, cast +from ..error import GraphQLError, GraphQLSyntaxError from .ast import ( ArgumentNode, BooleanValueNode, @@ -24,14 +25,14 @@ InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InputValueDefinitionNode, - IntValueNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, + IntValueNode, ListTypeNode, ListValueNode, Location, - NameNode, NamedTypeNode, + NameNode, NonNullTypeNode, NullValueNode, ObjectFieldNode, @@ -48,6 +49,7 @@ SelectionNode, SelectionSetNode, StringValueNode, + Token, TypeNode, TypeSystemExtensionNode, UnionTypeDefinitionNode, @@ -57,11 +59,9 @@ VariableNode, ) from .directive_locations import DirectiveLocation -from .ast import Token from .lexer import Lexer, is_punctuator_token_kind from .source import Source, is_source from .token_kind import TokenKind -from ..error import GraphQLError, GraphQLSyntaxError __all__ = ["parse", "parse_type", "parse_value", "parse_const_value"] @@ -401,8 +401,9 @@ def parse_arguments(self, is_const: bool) -> List[ArgumentNode]: """Arguments[Const]: (Argument[?Const]+)""" item = self.parse_const_argument if is_const else self.parse_argument - item = cast(Callable[[], ArgumentNode], item) - return self.optional_many(TokenKind.PAREN_L, item, TokenKind.PAREN_R) + return self.optional_many( + TokenKind.PAREN_L, cast(Callable[[], ArgumentNode], item), TokenKind.PAREN_R + ) def parse_argument(self, is_const: bool = False) -> ArgumentNode: """Argument[Const]: Name : Value[?Const]""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/src/graphql/language/visitor.py new/graphql_core-3.2.6/src/graphql/language/visitor.py --- old/graphql_core-3.2.5/src/graphql/language/visitor.py 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/src/graphql/language/visitor.py 2025-01-26 17:36:15.000000000 +0100 @@ -14,8 +14,7 @@ from ..pyutils import inspect, snake_to_camel from . import ast - -from .ast import Node, QUERY_DOCUMENT_KEYS +from .ast import QUERY_DOCUMENT_KEYS, Node __all__ = [ "Visitor", @@ -288,7 +287,7 @@ else: stack = Stack(in_array, idx, keys, edits, stack) in_array = isinstance(node, tuple) - keys = node if in_array else visitor_keys.get(node.kind, ()) + keys = node if in_array else visitor_keys.get(node.kind, ()) # type: ignore idx = -1 edits = [] if parent: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/src/graphql/type/definition.py new/graphql_core-3.2.6/src/graphql/type/definition.py --- old/graphql_core-3.2.5/src/graphql/type/definition.py 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/src/graphql/type/definition.py 2025-01-26 17:36:15.000000000 +0100 @@ -1389,7 +1389,7 @@ Example:: - NonNullFloat = GraphQLNonNull(GraphQLFloat()) + NonNullFloat = GraphQLNonNull(GraphQLFloat) class GeoPoint(GraphQLInputObjectType): name = 'GeoPoint' @@ -1397,7 +1397,7 @@ 'lat': GraphQLInputField(NonNullFloat), 'lon': GraphQLInputField(NonNullFloat), 'alt': GraphQLInputField( - GraphQLFloat(), default_value=0) + GraphQLFloat, default_value=0) } The outbound values will be Python dictionaries by default, but you can have them @@ -1651,7 +1651,7 @@ class RowType(GraphQLObjectType): name = 'Row' fields = { - 'id': GraphQLField(GraphQLNonNull(GraphQLString())) + 'id': GraphQLField(GraphQLNonNull(GraphQLString)) } Note: the enforcement of non-nullability occurs within the executor. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/src/graphql/type/schema.py new/graphql_core-3.2.6/src/graphql/type/schema.py --- old/graphql_core-3.2.5/src/graphql/type/schema.py 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/src/graphql/type/schema.py 2025-01-26 17:36:15.000000000 +0100 @@ -13,16 +13,17 @@ ) from ..error import GraphQLError -from ..language import ast, OperationType +from ..language import OperationType, ast from ..pyutils import inspect, is_collection, is_description from .definition import ( GraphQLAbstractType, - GraphQLInterfaceType, GraphQLInputObjectType, + GraphQLInputType, + GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType, - GraphQLUnionType, GraphQLType, + GraphQLUnionType, GraphQLWrappingType, get_named_type, is_input_object_type, @@ -31,7 +32,7 @@ is_union_type, is_wrapping_type, ) -from .directives import GraphQLDirective, specified_directives, is_directive +from .directives import GraphQLDirective, is_directive, specified_directives from .introspection import introspection_types try: @@ -310,8 +311,8 @@ def __deepcopy__(self, memo_: Dict) -> "GraphQLSchema": from ..type import ( is_introspection_type, - is_specified_scalar_type, is_specified_directive, + is_specified_scalar_type, ) type_map: TypeMap = { @@ -326,6 +327,8 @@ directive if is_specified_directive(directive) else copy(directive) for directive in self.directives ] + for directive in directives: + remap_directive(directive, type_map) return self.__class__( self.query_type and cast(GraphQLObjectType, type_map[self.query_type.name]), self.mutation_type @@ -461,12 +464,7 @@ def remap_named_type(type_: GraphQLNamedType, type_map: TypeMap) -> None: """Change all references in the given named type to use this type map.""" - if is_union_type(type_): - type_ = cast(GraphQLUnionType, type_) - type_.types = [ - type_map.get(member_type.name, member_type) for member_type in type_.types - ] - elif is_object_type(type_) or is_interface_type(type_): + if is_object_type(type_) or is_interface_type(type_): type_ = cast(Union[GraphQLObjectType, GraphQLInterfaceType], type_) type_.interfaces = [ type_map.get(interface_type.name, interface_type) @@ -482,6 +480,11 @@ arg.type = remapped_type(arg.type, type_map) args[arg_name] = arg fields[field_name] = field + elif is_union_type(type_): + type_ = cast(GraphQLUnionType, type_) + type_.types = [ + type_map.get(member_type.name, member_type) for member_type in type_.types + ] elif is_input_object_type(type_): type_ = cast(GraphQLInputObjectType, type_) fields = type_.fields @@ -489,3 +492,12 @@ field = copy(field) field.type = remapped_type(field.type, type_map) fields[field_name] = field + + +def remap_directive(directive: GraphQLDirective, type_map: TypeMap) -> None: + """Change all references in the given directive to use this type map.""" + args = directive.args + for arg_name, arg in args.items(): + arg = copy(arg) # noqa: PLW2901 + arg.type = cast(GraphQLInputType, remapped_type(arg.type, type_map)) + args[arg_name] = arg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/src/graphql/version.py new/graphql_core-3.2.6/src/graphql/version.py --- old/graphql_core-3.2.5/src/graphql/version.py 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/src/graphql/version.py 2025-01-26 17:36:15.000000000 +0100 @@ -4,7 +4,7 @@ __all__ = ["version", "version_info", "version_js", "version_info_js"] -version = "3.2.5" +version = "3.2.6" version_js = "16.8.2" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/src/graphql_core.egg-info/PKG-INFO new/graphql_core-3.2.6/src/graphql_core.egg-info/PKG-INFO --- old/graphql_core-3.2.5/src/graphql_core.egg-info/PKG-INFO 2024-10-13 20:24:27.000000000 +0200 +++ new/graphql_core-3.2.6/src/graphql_core.egg-info/PKG-INFO 2025-01-26 17:36:18.000000000 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.2 Name: graphql-core -Version: 3.2.5 +Version: 3.2.6 Summary: GraphQL implementation for Python, a port of GraphQL.js, the JavaScript reference implementation for GraphQL. Home-page: https://github.com/graphql-python/graphql-core Author: Christoph Zwerschke @@ -25,6 +25,17 @@ Description-Content-Type: text/markdown License-File: LICENSE Requires-Dist: typing-extensions<5,>=4; python_version < "3.10" +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: description-content-type +Dynamic: home-page +Dynamic: keywords +Dynamic: license +Dynamic: requires-dist +Dynamic: requires-python +Dynamic: summary # GraphQL-core 3 @@ -38,13 +49,18 @@  [](https://github.com/ambv/black) -The current version 3.2.5 of GraphQL-core is up-to-date with GraphQL.js version 16.8.2. +The current version 3.2.6 of GraphQL-core is up-to-date with GraphQL.js version 16.8.2. -An extensive test suite with over 2300 unit tests and 100% coverage comprises a +An extensive test suite with over 2500 unit tests and 100% coverage comprises a replication of the complete test suite of GraphQL.js, making sure this port is reliable and compatible with GraphQL.js. -Note that for various reasons, GraphQL-core does not use SemVer like GraphQL.js. Increases in the major version of GraphQL.js are reflected in the minor version of GraphQL-core instead. This means there can be breaking changes in the API when the minor version changes, and only patch releases are fully backward compatible. Therefore, we recommend something like `=~ 3.2.0` as version specifier when including GraphQL-core as a dependency. +Note that for various reasons, GraphQL-core does not use SemVer like GraphQL.js. +Changes in the major version of GraphQL.js are reflected in the minor version of +GraphQL-core instead. This means there can be breaking changes in the API +when the minor version changes, and only patch releases are fully backward compatible. +Therefore, we recommend using something like `~= 3.2.0` as the version specifier +when including GraphQL-core as a dependency. ## Documentation @@ -76,8 +92,8 @@ python -m pip install graphql-core -You can also use [poetry](https://github.com/python-poetry/poetry) for installation in a -virtual environment: +You can also use [poetry](https://github.com/python-poetry/poetry) for installation +in a virtual environment: poetry install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/tests/execution/test_abstract.py new/graphql_core-3.2.6/tests/execution/test_abstract.py --- old/graphql_core-3.2.5/tests/execution/test_abstract.py 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/tests/execution/test_abstract.py 2025-01-26 17:36:15.000000000 +0100 @@ -3,7 +3,7 @@ from pytest import mark -from graphql.execution import execute, execute_sync, ExecutionResult +from graphql.execution import ExecutionResult, execute, execute_sync from graphql.language import parse from graphql.type import ( GraphQLBoolean, @@ -40,9 +40,7 @@ assert isinstance(schema, GraphQLSchema) assert isinstance(query, str) document = parse(query) - result = (execute_sync if sync else execute)( - schema, document, root_value - ) # type: ignore + result = (execute_sync if sync else execute)(schema, document, root_value) if not sync and isawaitable(result): result = await result assert isinstance(result, ExecutionResult) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/tests/execution/test_resolve.py new/graphql_core-3.2.6/tests/execution/test_resolve.py --- old/graphql_core-3.2.5/tests/execution/test_resolve.py 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/tests/execution/test_resolve.py 2025-01-26 17:36:15.000000000 +0100 @@ -2,14 +2,16 @@ from typing import Any from graphql.error import GraphQLError -from graphql.execution import execute_sync, ExecutionResult -from graphql.language import parse, SourceLocation +from graphql.execution import ExecutionResult, execute_sync +from graphql.language import SourceLocation, parse from graphql.type import ( GraphQLArgument, GraphQLField, + GraphQLID, GraphQLInputField, GraphQLInputObjectType, GraphQLInt, + GraphQLList, GraphQLObjectType, GraphQLSchema, GraphQLString, @@ -213,6 +215,91 @@ None, ) + def transforms_default_values_using_out_names(): + # This is an extension of GraphQL.js. + resolver_kwargs: Any + + def search_resolver(_obj: None, _info, **kwargs): + nonlocal resolver_kwargs + resolver_kwargs = kwargs + return [{"id": "42"}] + + filters_type = GraphQLInputObjectType( + "SearchFilters", + {"pageSize": GraphQLInputField(GraphQLInt, out_name="page_size")}, + ) + result_type = GraphQLObjectType("SearchResult", {"id": GraphQLField(GraphQLID)}) + query = GraphQLObjectType( + "Query", + { + "search": GraphQLField( + GraphQLList(result_type), + { + "searchFilters": GraphQLArgument( + filters_type, {"pageSize": 10}, out_name="search_filters" + ) + }, + resolve=search_resolver, + ) + }, + ) + schema = GraphQLSchema(query) + + resolver_kwargs = None + result = execute_sync(schema, parse("{ search { id } }")) + assert result == ({"search": [{"id": "42"}]}, None) + assert resolver_kwargs == {"search_filters": {"page_size": 10}} + + resolver_kwargs = None + result = execute_sync( + schema, parse("{ search(searchFilters:{pageSize: 25}) { id } }") + ) + assert result == ({"search": [{"id": "42"}]}, None) + assert resolver_kwargs == {"search_filters": {"page_size": 25}} + + resolver_kwargs = None + result = execute_sync( + schema, + parse( + """ + query ($searchFilters: SearchFilters) { + search(searchFilters: $searchFilters) { id } + } + """ + ), + ) + assert result == ({"search": [{"id": "42"}]}, None) + assert resolver_kwargs == {"search_filters": {"page_size": 10}} + + resolver_kwargs = None + result = execute_sync( + schema, + parse( + """ + query ($searchFilters: SearchFilters) { + search(searchFilters: $searchFilters) { id } + } + """ + ), + variable_values={"searchFilters": {"pageSize": 25}}, + ) + assert result == ({"search": [{"id": "42"}]}, None) + assert resolver_kwargs == {"search_filters": {"page_size": 25}} + + resolver_kwargs = None + result = execute_sync( + schema, + parse( + """ + query ($searchFilters: SearchFilters = {pageSize: 25}) { + search(searchFilters: $searchFilters) { id } + } + """ + ), + ) + assert result == ({"search": [{"id": "42"}]}, None) + assert resolver_kwargs == {"search_filters": {"page_size": 25}} + def pass_error_from_resolver_wrapped_as_located_graphql_error(): def resolve(_obj, _info): raise ValueError("Some error") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/graphql_core-3.2.5/tox.ini new/graphql_core-3.2.6/tox.ini --- old/graphql_core-3.2.5/tox.ini 2024-10-13 20:24:24.000000000 +0200 +++ new/graphql_core-3.2.6/tox.ini 2025-01-26 17:36:15.000000000 +0100 @@ -19,9 +19,9 @@ [testenv:black] basepython = python3.12 -deps = black==24.8.0 +deps = black==24.10.0 commands = - black src tests setup.py -t py311 --check + black src tests setup.py -t py312 --check [testenv:flake8] basepython = python3.12 @@ -32,7 +32,7 @@ [testenv:mypy] basepython = python3.12 deps = - mypy>=1.11,<2 + mypy>=1.14,<2 pytest>=8.3,<9 commands = mypy src tests @@ -40,28 +40,28 @@ [testenv:docs] basepython = python3.12 deps = - sphinx>=7,<8 - sphinx_rtd_theme>=2.0,<3 + sphinx>=8,<9 + sphinx_rtd_theme>=3,<4 commands = sphinx-build -b html -nEW docs docs/_build/html [testenv:manifest] basepython = python3.12 -deps = check-manifest>=0.49,<1 +deps = check-manifest>=0.50,<1 commands = check-manifest -v [testenv] deps = pytest>=6.2,<9 - pytest-asyncio>=0.16,<0.24 - pytest-benchmark>=3.4,<5 - pytest-cov>=4,<6 + pytest-asyncio>=0.16,<1 + pytest-benchmark>=3.4,<6 + pytest-cov>=4,<7 pytest-describe>=2,<3 pytest-timeout>=2,<3 - py3{6,7,8,9}, pypy39: typing-extensions>=4,<5 + py3{6,7,8,9},pypy39: typing-extensions>=4.1,<5 commands = # to also run the time-consuming tests: tox -e py311 -- --run-slow # to run the benchmarks: tox -e py311 -- -k benchmarks --benchmark-enable - py3{6,7,8,9,10,11,13}, pypy3{9,10}: pytest tests {posargs} + py3{6,7,8,9,10,11,13},pypy3{9,10}: pytest tests {posargs} py312: pytest tests {posargs: --cov-report=term-missing --cov=graphql --cov=tests --cov-fail-under=100}