graphql-core 3.2.10__tar.gz → 3.2.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {graphql_core-3.2.10 → graphql_core-3.2.12}/.bumpversion.cfg +3 -3
- {graphql_core-3.2.10 → graphql_core-3.2.12}/PKG-INFO +2 -2
- {graphql_core-3.2.10 → graphql_core-3.2.12}/README.md +1 -1
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/conf.py +1 -1
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/modules/language.rst +1 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/pyproject.toml +2 -2
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/__init__.py +2 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/error/graphql_error.py +5 -1
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/execution/values.py +4 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/__init__.py +2 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/ast.py +28 -3
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/directive_locations.py +1 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/parser.py +88 -11
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/predicates.py +4 -1
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/printer.py +6 -1
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/visitor.py +4 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/type/directives.py +28 -1
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/type/introspection.py +37 -2
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/assert_valid_name.py +7 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/ast_from_value.py +1 -3
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/build_ast_schema.py +4 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/build_client_schema.py +1 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/extend_schema.py +63 -4
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/get_introspection_query.py +31 -39
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/get_operation_root_type.py +5 -1
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/introspection_from_schema.py +2 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/print_schema.py +1 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/type_info.py +2 -1
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/known_directives.py +2 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/overlapping_fields_can_be_merged.py +59 -10
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/unique_directives_per_location.py +7 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/values_of_correct_type.py +0 -13
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/validate.py +2 -1
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/version.py +2 -2
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql_core.egg-info/PKG-INFO +2 -2
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_abstract.py +3 -1
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_parser.py +29 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_predicates.py +1 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_printer.py +14 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_schema_parser.py +9 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/type/test_directives.py +44 -1
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/type/test_introspection.py +183 -1
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_build_ast_schema.py +15 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_build_client_schema.py +25 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_extend_schema.py +95 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_get_introspection_query.py +38 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_introspection_from_schema.py +33 -1
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_print_schema.py +22 -2
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_value_from_ast.py +9 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_known_directives.py +10 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_overlapping_fields_can_be_merged.py +91 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_unique_directives_per_location.py +81 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tox.ini +4 -4
- {graphql_core-3.2.10 → graphql_core-3.2.12}/.coveragerc +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/.editorconfig +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/.flake8 +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/.mypy.ini +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/.readthedocs.yaml +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/CODEOWNERS +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/LICENSE +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/MANIFEST.in +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/SECURITY.md +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/Makefile +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/diffs.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/index.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/intro.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/make.bat +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/modules/error.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/modules/execution.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/modules/graphql.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/modules/pyutils.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/modules/type.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/modules/utilities.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/modules/validation.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/requirements.txt +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/usage/extension.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/usage/index.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/usage/introspection.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/usage/methods.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/usage/other.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/usage/parser.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/usage/queries.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/usage/resolvers.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/usage/schema.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/usage/sdl.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/docs/usage/validator.rst +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/poetry.lock +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/setup.cfg +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/setup.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/error/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/error/located_error.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/error/syntax_error.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/execution/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/execution/collect_fields.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/execution/execute.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/execution/map_async_iterator.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/execution/middleware.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/execution/subscribe.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/graphql.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/block_string.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/character_classes.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/lexer.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/location.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/print_location.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/print_string.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/schema_coordinate_lexer.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/source.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/language/token_kind.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/py.typed +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/awaitable_or_value.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/cached_property.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/convert_case.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/description.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/did_you_mean.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/frozen_dict.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/frozen_error.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/frozen_list.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/group_by.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/identity_func.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/inspect.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/is_awaitable.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/is_iterable.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/merge_kwargs.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/natural_compare.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/path.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/print_path_list.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/simple_pub_sub.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/suggestion_list.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/pyutils/undefined.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/subscription/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/type/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/type/assert_name.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/type/definition.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/type/scalars.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/type/schema.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/type/validate.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/ast_to_dict.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/coerce_input_value.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/concat_ast.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/find_breaking_changes.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/get_operation_ast.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/lexicographic_sort_schema.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/resolve_schema_coordinate.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/separate_operations.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/sort_value_node.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/strip_ignored_characters.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/type_comparators.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/type_from_ast.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/value_from_ast.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/utilities/value_from_ast_untyped.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/custom/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/custom/no_deprecated.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/custom/no_schema_introspection.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/executable_definitions.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/fields_on_correct_type.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/fragments_on_composite_types.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/known_argument_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/known_fragment_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/known_type_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/lone_anonymous_operation.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/lone_schema_definition.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/max_introspection_depth_rule.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/no_fragment_cycles.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/no_undefined_variables.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/no_unused_fragments.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/no_unused_variables.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/possible_fragment_spreads.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/possible_type_extensions.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/provided_required_arguments.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/scalar_leafs.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/single_field_subscriptions.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/unique_argument_definition_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/unique_argument_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/unique_directive_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/unique_enum_value_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/unique_field_definition_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/unique_fragment_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/unique_input_field_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/unique_operation_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/unique_operation_types.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/unique_type_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/unique_variable_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/variables_are_input_types.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/rules/variables_in_allowed_position.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/specified_rules.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql/validation/validation_context.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql_core.egg-info/SOURCES.txt +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql_core.egg-info/dependency_links.txt +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql_core.egg-info/not-zip-safe +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql_core.egg-info/requires.txt +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/src/graphql_core.egg-info/top_level.txt +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/benchmarks/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/benchmarks/test_build_ast_schema.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/benchmarks/test_build_client_schema.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/benchmarks/test_execution_async.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/benchmarks/test_execution_sync.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/benchmarks/test_introspection_from_schema.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/benchmarks/test_parser.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/benchmarks/test_print.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/benchmarks/test_repeated_fields.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/benchmarks/test_validate_gql.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/benchmarks/test_validate_invalid_gql.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/benchmarks/test_validate_sdl.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/benchmarks/test_visit.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/conftest.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/error/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/error/test_graphql_error.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/error/test_located_error.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/error/test_print_location.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_customize.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_directives.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_execution_result.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_executor.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_lists.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_map_async_iterator.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_middleware.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_mutations.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_nonnull.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_one_of.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_parallel.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_resolve.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_schema.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_subscribe.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_sync.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_union_interface.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/execution/test_variables.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/fixtures/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/fixtures/github_schema.graphql +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/fixtures/github_schema.json +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/fixtures/kitchen_sink.graphql +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/fixtures/schema_kitchen_sink.graphql +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_ast.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_block_string.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_block_string_fuzz.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_character_classes.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_lexer.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_location.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_print_string.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_schema_coordinate_lexer.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_schema_printer.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_source.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/language/test_visitor.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_cached_property.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_convert_case.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_description.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_did_you_mean.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_frozen_dict.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_frozen_error.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_frozen_list.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_group_by.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_identity_func.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_inspect.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_is_awaitable.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_is_iterable.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_merge_kwargs.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_natural_compare.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_path.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_print_path_list.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_simple_pub_sub.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_suggestion_list.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/pyutils/test_undefined.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/star_wars_data.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/star_wars_schema.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/test_docs.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/test_star_wars_introspection.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/test_star_wars_query.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/test_star_wars_validation.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/test_user_registry.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/test_version.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/type/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/type/test_assert_name.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/type/test_custom_scalars.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/type/test_definition.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/type/test_enum.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/type/test_extensions.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/type/test_predicate.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/type/test_scalars.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/type/test_schema.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/type/test_validation.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_ast_from_value.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_ast_to_dict.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_coerce_input_value.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_concat_ast.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_find_breaking_changes.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_get_operation_ast.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_get_operation_root_type.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_lexicographic_sort_schema.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_resolve_schema_coordinate.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_separate_operations.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_sort_value_node.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_strip_ignored_characters.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_strip_ignored_characters_fuzz.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_type_comparators.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_type_from_ast.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_type_info.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utilities/test_value_from_ast_untyped.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utils/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utils/dedent.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utils/gen_fuzz_strings.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utils/test_dedent.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/utils/test_gen_fuzz_strings.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/__init__.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/harness.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_executable_definitions.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_fields_on_correct_type.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_fragments_on_composite_types.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_known_argument_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_known_fragment_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_known_type_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_lone_anonymous_operation.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_lone_schema_definition.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_max_introspection_depth_rule.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_no_deprecated.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_no_fragment_cycles.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_no_schema_introspection.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_no_undefined_variables.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_no_unused_fragments.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_no_unused_variables.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_possible_fragment_spreads.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_possible_type_extensions.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_provided_required_arguments.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_scalar_leafs.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_single_field_subscriptions.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_unique_argument_definition_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_unique_argument_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_unique_directive_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_unique_enum_value_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_unique_field_definition_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_unique_fragment_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_unique_input_field_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_unique_operation_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_unique_operation_types.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_unique_type_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_unique_variable_names.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_validation.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_values_of_correct_type.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_variables_are_input_types.py +0 -0
- {graphql_core-3.2.10 → graphql_core-3.2.12}/tests/validation/test_variables_in_allowed_position.py +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[bumpversion]
|
|
2
|
-
current_version = 3.2.
|
|
2
|
+
current_version = 3.2.12
|
|
3
3
|
commit = False
|
|
4
4
|
tag = False
|
|
5
5
|
|
|
@@ -8,8 +8,8 @@ search = version = "{current_version}"
|
|
|
8
8
|
replace = version = "{new_version}"
|
|
9
9
|
|
|
10
10
|
[bumpversion:file:docs/conf.py]
|
|
11
|
-
search = version = release =
|
|
12
|
-
replace = version = release =
|
|
11
|
+
search = version = release = "{current_version}"
|
|
12
|
+
replace = version = release = "{new_version}"
|
|
13
13
|
|
|
14
14
|
[bumpversion:file:README.md]
|
|
15
15
|
search = The current version {current_version}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: graphql-core
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.12
|
|
4
4
|
Summary: GraphQL implementation for Python, a port of GraphQL.js, the JavaScript reference implementation for GraphQL.
|
|
5
5
|
Home-page: https://github.com/graphql-python/graphql-core
|
|
6
6
|
Author: Christoph Zwerschke
|
|
@@ -50,7 +50,7 @@ a query language for APIs created by Facebook.
|
|
|
50
50
|

|
|
51
51
|
[](https://github.com/ambv/black)
|
|
52
52
|
|
|
53
|
-
The current version 3.2.
|
|
53
|
+
The current version 3.2.12 of GraphQL-core is up-to-date with GraphQL.js version 16.14.2.
|
|
54
54
|
|
|
55
55
|
An extensive test suite with over 2500 unit tests and 100% coverage comprises a
|
|
56
56
|
replication of the complete test suite of GraphQL.js, making sure this port is
|
|
@@ -10,7 +10,7 @@ a query language for APIs created by Facebook.
|
|
|
10
10
|

|
|
11
11
|
[](https://github.com/ambv/black)
|
|
12
12
|
|
|
13
|
-
The current version 3.2.
|
|
13
|
+
The current version 3.2.12 of GraphQL-core is up-to-date with GraphQL.js version 16.14.2.
|
|
14
14
|
|
|
15
15
|
An extensive test suite with over 2500 unit tests and 100% coverage comprises a
|
|
16
16
|
replication of the complete test suite of GraphQL.js, making sure this port is
|
|
@@ -61,7 +61,7 @@ author = "Christoph Zwerschke"
|
|
|
61
61
|
# The short X.Y version.
|
|
62
62
|
# version = '3.2'
|
|
63
63
|
# The full version, including alpha/beta/rc tags.
|
|
64
|
-
version = release = "3.2.
|
|
64
|
+
version = release = "3.2.12"
|
|
65
65
|
|
|
66
66
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
67
67
|
# for a list of supported languages.
|
|
@@ -25,6 +25,7 @@ Each kind of AST node has its own class:
|
|
|
25
25
|
.. autoclass:: ConstValueNode
|
|
26
26
|
.. autoclass:: DefinitionNode
|
|
27
27
|
.. autoclass:: DirectiveDefinitionNode
|
|
28
|
+
.. autoclass:: DirectiveExtensionNode
|
|
28
29
|
.. autoclass:: DirectiveNode
|
|
29
30
|
.. autoclass:: DocumentNode
|
|
30
31
|
.. autoclass:: EnumTypeDefinitionNode
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "graphql-core"
|
|
3
|
-
version = "3.2.
|
|
3
|
+
version = "3.2.12"
|
|
4
4
|
description = """
|
|
5
5
|
GraphQL-core is a Python port of GraphQL.js,\
|
|
6
6
|
the JavaScript reference implementation for GraphQL."""
|
|
@@ -87,5 +87,5 @@ disable = [
|
|
|
87
87
|
]
|
|
88
88
|
|
|
89
89
|
[build-system]
|
|
90
|
-
requires = ["poetry_core>=1,<3", "setuptools>=59,<
|
|
90
|
+
requires = ["poetry_core>=1,<3", "setuptools>=59,<85"]
|
|
91
91
|
build-backend = "poetry.core.masonry.api"
|
|
@@ -160,6 +160,7 @@ from .language import (
|
|
|
160
160
|
UnionTypeExtensionNode,
|
|
161
161
|
EnumTypeExtensionNode,
|
|
162
162
|
InputObjectTypeExtensionNode,
|
|
163
|
+
DirectiveExtensionNode,
|
|
163
164
|
# Schema Coordinates
|
|
164
165
|
SchemaCoordinateNode,
|
|
165
166
|
TypeCoordinateNode,
|
|
@@ -709,6 +710,7 @@ __all__ = [
|
|
|
709
710
|
"UnionTypeExtensionNode",
|
|
710
711
|
"EnumTypeExtensionNode",
|
|
711
712
|
"InputObjectTypeExtensionNode",
|
|
713
|
+
"DirectiveExtensionNode",
|
|
712
714
|
"SchemaCoordinateNode",
|
|
713
715
|
"TypeCoordinateNode",
|
|
714
716
|
"MemberCoordinateNode",
|
|
@@ -254,6 +254,8 @@ def print_error(error: GraphQLError) -> str:
|
|
|
254
254
|
"""Print a GraphQLError to a string.
|
|
255
255
|
|
|
256
256
|
Represents useful location information about the error's position in the source.
|
|
257
|
+
This deprecated helper is retained for backwards compatibility; call ``str(error)``
|
|
258
|
+
instead because ``print_error`` will be removed in v3.3.
|
|
257
259
|
|
|
258
260
|
.. deprecated:: 3.2
|
|
259
261
|
Please use ``str(error)`` instead. Will be removed in v3.3.
|
|
@@ -267,7 +269,9 @@ def format_error(error: GraphQLError) -> GraphQLFormattedError:
|
|
|
267
269
|
"""Format a GraphQL error.
|
|
268
270
|
|
|
269
271
|
Given a GraphQLError, format it according to the rules described by the "Response
|
|
270
|
-
Format, Errors" section of the GraphQL Specification.
|
|
272
|
+
Format, Errors" section of the GraphQL Specification. This deprecated helper is
|
|
273
|
+
retained for backwards compatibility; use ``error.formatted`` instead because
|
|
274
|
+
``format_error`` will be removed in v3.3.
|
|
271
275
|
|
|
272
276
|
.. deprecated:: 3.2
|
|
273
277
|
Please use ``error.formatted`` instead. Will be removed in v3.3.
|
|
@@ -2,6 +2,8 @@ from typing import Any, Callable, Collection, Dict, List, Optional, Union, cast
|
|
|
2
2
|
|
|
3
3
|
from ..error import GraphQLError
|
|
4
4
|
from ..language import (
|
|
5
|
+
DirectiveDefinitionNode,
|
|
6
|
+
DirectiveExtensionNode,
|
|
5
7
|
DirectiveNode,
|
|
6
8
|
EnumValueDefinitionNode,
|
|
7
9
|
ExecutableDefinitionNode,
|
|
@@ -224,6 +226,8 @@ def get_argument_values(
|
|
|
224
226
|
|
|
225
227
|
|
|
226
228
|
NodeWithDirective = Union[
|
|
229
|
+
DirectiveDefinitionNode,
|
|
230
|
+
DirectiveExtensionNode,
|
|
227
231
|
EnumValueDefinitionNode,
|
|
228
232
|
ExecutableDefinitionNode,
|
|
229
233
|
FieldDefinitionNode,
|
|
@@ -100,6 +100,7 @@ from .ast import (
|
|
|
100
100
|
UnionTypeExtensionNode,
|
|
101
101
|
EnumTypeExtensionNode,
|
|
102
102
|
InputObjectTypeExtensionNode,
|
|
103
|
+
DirectiveExtensionNode,
|
|
103
104
|
SchemaCoordinateNode,
|
|
104
105
|
TypeCoordinateNode,
|
|
105
106
|
MemberCoordinateNode,
|
|
@@ -209,6 +210,7 @@ __all__ = [
|
|
|
209
210
|
"UnionTypeExtensionNode",
|
|
210
211
|
"EnumTypeExtensionNode",
|
|
211
212
|
"InputObjectTypeExtensionNode",
|
|
213
|
+
"DirectiveExtensionNode",
|
|
212
214
|
"SchemaCoordinateNode",
|
|
213
215
|
"TypeCoordinateNode",
|
|
214
216
|
"MemberCoordinateNode",
|
|
@@ -69,6 +69,7 @@ __all__ = [
|
|
|
69
69
|
"UnionTypeExtensionNode",
|
|
70
70
|
"EnumTypeExtensionNode",
|
|
71
71
|
"InputObjectTypeExtensionNode",
|
|
72
|
+
"DirectiveExtensionNode",
|
|
72
73
|
"SchemaCoordinateNode",
|
|
73
74
|
"TypeCoordinateNode",
|
|
74
75
|
"MemberCoordinateNode",
|
|
@@ -312,8 +313,15 @@ QUERY_DOCUMENT_KEYS: Dict[str, Tuple[str, ...]] = {
|
|
|
312
313
|
"enum_type_definition": ("description", "name", "directives", "values"),
|
|
313
314
|
"enum_value_definition": ("description", "name", "directives"),
|
|
314
315
|
"input_object_type_definition": ("description", "name", "directives", "fields"),
|
|
315
|
-
"directive_definition": (
|
|
316
|
+
"directive_definition": (
|
|
317
|
+
"description",
|
|
318
|
+
"name",
|
|
319
|
+
"arguments",
|
|
320
|
+
"directives",
|
|
321
|
+
"locations",
|
|
322
|
+
),
|
|
316
323
|
"schema_extension": ("directives", "operation_types"),
|
|
324
|
+
"directive_extension": ("name", "directives"),
|
|
317
325
|
"scalar_type_extension": ("name", "directives"),
|
|
318
326
|
"object_type_extension": ("name", "interfaces", "directives", "fields"),
|
|
319
327
|
"interface_type_extension": ("name", "interfaces", "directives", "fields"),
|
|
@@ -771,11 +779,19 @@ class InputObjectTypeDefinitionNode(TypeDefinitionNode):
|
|
|
771
779
|
|
|
772
780
|
|
|
773
781
|
class DirectiveDefinitionNode(TypeSystemDefinitionNode):
|
|
774
|
-
__slots__ =
|
|
782
|
+
__slots__ = (
|
|
783
|
+
"description",
|
|
784
|
+
"name",
|
|
785
|
+
"arguments",
|
|
786
|
+
"directives",
|
|
787
|
+
"repeatable",
|
|
788
|
+
"locations",
|
|
789
|
+
)
|
|
775
790
|
|
|
776
791
|
description: Optional[StringValueNode]
|
|
777
792
|
name: NameNode
|
|
778
793
|
arguments: Tuple[InputValueDefinitionNode, ...]
|
|
794
|
+
directives: Tuple[ConstDirectiveNode, ...]
|
|
779
795
|
repeatable: bool
|
|
780
796
|
locations: Tuple[NameNode, ...]
|
|
781
797
|
|
|
@@ -790,6 +806,13 @@ class SchemaExtensionNode(Node):
|
|
|
790
806
|
operation_types: Tuple[OperationTypeDefinitionNode, ...]
|
|
791
807
|
|
|
792
808
|
|
|
809
|
+
class DirectiveExtensionNode(Node):
|
|
810
|
+
__slots__ = "name", "directives"
|
|
811
|
+
|
|
812
|
+
name: NameNode
|
|
813
|
+
directives: Tuple[ConstDirectiveNode, ...]
|
|
814
|
+
|
|
815
|
+
|
|
793
816
|
# Type Extensions
|
|
794
817
|
|
|
795
818
|
|
|
@@ -800,7 +823,9 @@ class TypeExtensionNode(TypeSystemDefinitionNode):
|
|
|
800
823
|
directives: Tuple[ConstDirectiveNode, ...]
|
|
801
824
|
|
|
802
825
|
|
|
803
|
-
TypeSystemExtensionNode = Union[
|
|
826
|
+
TypeSystemExtensionNode = Union[
|
|
827
|
+
SchemaExtensionNode, TypeExtensionNode, DirectiveExtensionNode
|
|
828
|
+
]
|
|
804
829
|
|
|
805
830
|
|
|
806
831
|
class ScalarTypeExtensionNode(TypeExtensionNode):
|
|
@@ -13,6 +13,7 @@ from .ast import (
|
|
|
13
13
|
DirectiveArgumentCoordinateNode,
|
|
14
14
|
DirectiveCoordinateNode,
|
|
15
15
|
DirectiveDefinitionNode,
|
|
16
|
+
DirectiveExtensionNode,
|
|
16
17
|
DirectiveNode,
|
|
17
18
|
DocumentNode,
|
|
18
19
|
EnumTypeDefinitionNode,
|
|
@@ -88,6 +89,7 @@ def parse(
|
|
|
88
89
|
no_location: bool = False,
|
|
89
90
|
max_tokens: Optional[int] = None,
|
|
90
91
|
allow_legacy_fragment_variables: bool = False,
|
|
92
|
+
experimental_directives_on_directive_definitions: bool = False,
|
|
91
93
|
) -> DocumentNode:
|
|
92
94
|
"""Given a GraphQL source, parse it into a Document.
|
|
93
95
|
|
|
@@ -111,17 +113,33 @@ def parse(
|
|
|
111
113
|
:attr:`~graphql.language.FragmentDefinitionNode.variable_definitions` field
|
|
112
114
|
of the :class:`~graphql.language.FragmentDefinitionNode`.
|
|
113
115
|
|
|
116
|
+
This legacy fragment variable syntax is deprecated. Move variable definitions to
|
|
117
|
+
operations for spec-compliant documents; if you need variables or arguments scoped
|
|
118
|
+
to fragments, the more complete experimental fragment-arguments feature in
|
|
119
|
+
graphql-core 3.3 should be used instead.
|
|
120
|
+
|
|
114
121
|
The syntax is identical to normal, query-defined variables. For example::
|
|
115
122
|
|
|
116
123
|
fragment A($var: Boolean = false) on T {
|
|
117
124
|
...
|
|
118
125
|
}
|
|
126
|
+
|
|
127
|
+
Experimental feature:
|
|
128
|
+
|
|
129
|
+
If ``experimental_directives_on_directive_definitions`` is set to ``True``, the
|
|
130
|
+
parser will understand and parse directives on directive definitions. This syntax
|
|
131
|
+
is not part of the GraphQL specification and may change. For example::
|
|
132
|
+
|
|
133
|
+
directive @foo @bar on FIELD
|
|
119
134
|
"""
|
|
120
135
|
parser = Parser(
|
|
121
136
|
source,
|
|
122
137
|
no_location=no_location,
|
|
123
138
|
max_tokens=max_tokens,
|
|
124
139
|
allow_legacy_fragment_variables=allow_legacy_fragment_variables,
|
|
140
|
+
experimental_directives_on_directive_definitions=(
|
|
141
|
+
experimental_directives_on_directive_definitions
|
|
142
|
+
),
|
|
125
143
|
)
|
|
126
144
|
return parser.parse_document()
|
|
127
145
|
|
|
@@ -131,6 +149,7 @@ def parse_value(
|
|
|
131
149
|
no_location: bool = False,
|
|
132
150
|
max_tokens: Optional[int] = None,
|
|
133
151
|
allow_legacy_fragment_variables: bool = False,
|
|
152
|
+
experimental_directives_on_directive_definitions: bool = False,
|
|
134
153
|
) -> ValueNode:
|
|
135
154
|
"""Parse the AST for a given string containing a GraphQL value.
|
|
136
155
|
|
|
@@ -147,6 +166,9 @@ def parse_value(
|
|
|
147
166
|
no_location=no_location,
|
|
148
167
|
max_tokens=max_tokens,
|
|
149
168
|
allow_legacy_fragment_variables=allow_legacy_fragment_variables,
|
|
169
|
+
experimental_directives_on_directive_definitions=(
|
|
170
|
+
experimental_directives_on_directive_definitions
|
|
171
|
+
),
|
|
150
172
|
)
|
|
151
173
|
parser.expect_token(TokenKind.SOF)
|
|
152
174
|
value = parser.parse_value_literal(False)
|
|
@@ -159,6 +181,7 @@ def parse_const_value(
|
|
|
159
181
|
no_location: bool = False,
|
|
160
182
|
max_tokens: Optional[int] = None,
|
|
161
183
|
allow_legacy_fragment_variables: bool = False,
|
|
184
|
+
experimental_directives_on_directive_definitions: bool = False,
|
|
162
185
|
) -> ConstValueNode:
|
|
163
186
|
"""Parse the AST for a given string containing a GraphQL constant value.
|
|
164
187
|
|
|
@@ -170,6 +193,9 @@ def parse_const_value(
|
|
|
170
193
|
no_location=no_location,
|
|
171
194
|
max_tokens=max_tokens,
|
|
172
195
|
allow_legacy_fragment_variables=allow_legacy_fragment_variables,
|
|
196
|
+
experimental_directives_on_directive_definitions=(
|
|
197
|
+
experimental_directives_on_directive_definitions
|
|
198
|
+
),
|
|
173
199
|
)
|
|
174
200
|
parser.expect_token(TokenKind.SOF)
|
|
175
201
|
value = parser.parse_const_value_literal()
|
|
@@ -182,6 +208,7 @@ def parse_type(
|
|
|
182
208
|
no_location: bool = False,
|
|
183
209
|
max_tokens: Optional[int] = None,
|
|
184
210
|
allow_legacy_fragment_variables: bool = False,
|
|
211
|
+
experimental_directives_on_directive_definitions: bool = False,
|
|
185
212
|
) -> TypeNode:
|
|
186
213
|
"""Parse the AST for a given string containing a GraphQL Type.
|
|
187
214
|
|
|
@@ -198,6 +225,9 @@ def parse_type(
|
|
|
198
225
|
no_location=no_location,
|
|
199
226
|
max_tokens=max_tokens,
|
|
200
227
|
allow_legacy_fragment_variables=allow_legacy_fragment_variables,
|
|
228
|
+
experimental_directives_on_directive_definitions=(
|
|
229
|
+
experimental_directives_on_directive_definitions
|
|
230
|
+
),
|
|
201
231
|
)
|
|
202
232
|
parser.expect_token(TokenKind.SOF)
|
|
203
233
|
type_ = parser.parse_type_reference()
|
|
@@ -247,6 +277,7 @@ class Parser:
|
|
|
247
277
|
_no_location: bool
|
|
248
278
|
_max_tokens: Optional[int]
|
|
249
279
|
_allow_legacy_fragment_variables: bool
|
|
280
|
+
_experimental_directives_on_directive_definitions: bool
|
|
250
281
|
_token_counter: int
|
|
251
282
|
|
|
252
283
|
def __init__(
|
|
@@ -255,6 +286,7 @@ class Parser:
|
|
|
255
286
|
no_location: bool = False,
|
|
256
287
|
max_tokens: Optional[int] = None,
|
|
257
288
|
allow_legacy_fragment_variables: bool = False,
|
|
289
|
+
experimental_directives_on_directive_definitions: bool = False,
|
|
258
290
|
lexer: Optional[Lexer] = None,
|
|
259
291
|
):
|
|
260
292
|
source = (
|
|
@@ -267,6 +299,9 @@ class Parser:
|
|
|
267
299
|
self._no_location = no_location
|
|
268
300
|
self._max_tokens = max_tokens
|
|
269
301
|
self._allow_legacy_fragment_variables = allow_legacy_fragment_variables
|
|
302
|
+
self._experimental_directives_on_directive_definitions = (
|
|
303
|
+
experimental_directives_on_directive_definitions
|
|
304
|
+
)
|
|
270
305
|
self._token_counter = 0
|
|
271
306
|
|
|
272
307
|
def parse_name(self) -> NameNode:
|
|
@@ -710,6 +745,11 @@ class Parser:
|
|
|
710
745
|
)
|
|
711
746
|
if method_name: # pragma: no cover
|
|
712
747
|
return getattr(self, f"parse_{method_name}")()
|
|
748
|
+
if (
|
|
749
|
+
keyword_token.value == "directive"
|
|
750
|
+
and self._experimental_directives_on_directive_definitions
|
|
751
|
+
):
|
|
752
|
+
return self.parse_directive_definition_extension()
|
|
713
753
|
raise self.unexpected(keyword_token)
|
|
714
754
|
|
|
715
755
|
def peek_description(self) -> bool:
|
|
@@ -1057,6 +1097,22 @@ class Parser:
|
|
|
1057
1097
|
name=name, directives=directives, fields=fields, loc=self.loc(start)
|
|
1058
1098
|
)
|
|
1059
1099
|
|
|
1100
|
+
def parse_directive_definition_extension(self) -> DirectiveExtensionNode:
|
|
1101
|
+
"""DirectiveDefinitionExtension"""
|
|
1102
|
+
start = self._lexer.token
|
|
1103
|
+
self.expect_keyword("extend")
|
|
1104
|
+
self.expect_keyword("directive")
|
|
1105
|
+
self.expect_token(TokenKind.AT)
|
|
1106
|
+
name = self.parse_name()
|
|
1107
|
+
directives = self.parse_const_directives()
|
|
1108
|
+
if not directives:
|
|
1109
|
+
raise self.unexpected()
|
|
1110
|
+
return DirectiveExtensionNode(
|
|
1111
|
+
name=name,
|
|
1112
|
+
directives=directives,
|
|
1113
|
+
loc=self.loc(start),
|
|
1114
|
+
)
|
|
1115
|
+
|
|
1060
1116
|
def parse_directive_definition(self) -> DirectiveDefinitionNode:
|
|
1061
1117
|
"""DirectiveDefinition"""
|
|
1062
1118
|
start = self._lexer.token
|
|
@@ -1065,6 +1121,11 @@ class Parser:
|
|
|
1065
1121
|
self.expect_token(TokenKind.AT)
|
|
1066
1122
|
name = self.parse_name()
|
|
1067
1123
|
args = self.parse_argument_defs()
|
|
1124
|
+
directives = (
|
|
1125
|
+
self.parse_const_directives()
|
|
1126
|
+
if self._experimental_directives_on_directive_definitions
|
|
1127
|
+
else []
|
|
1128
|
+
)
|
|
1068
1129
|
repeatable = self.expect_optional_keyword("repeatable")
|
|
1069
1130
|
self.expect_keyword("on")
|
|
1070
1131
|
locations = self.parse_directive_locations()
|
|
@@ -1072,6 +1133,7 @@ class Parser:
|
|
|
1072
1133
|
description=description,
|
|
1073
1134
|
name=name,
|
|
1074
1135
|
arguments=args,
|
|
1136
|
+
directives=directives,
|
|
1075
1137
|
repeatable=repeatable,
|
|
1076
1138
|
locations=locations,
|
|
1077
1139
|
loc=self.loc(start),
|
|
@@ -1293,18 +1355,33 @@ class Parser:
|
|
|
1293
1355
|
return nodes
|
|
1294
1356
|
|
|
1295
1357
|
def advance_lexer(self) -> None:
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1358
|
+
"""Advance the lexer.
|
|
1359
|
+
|
|
1360
|
+
Counts every token that is consumed toward ``max_tokens``, including the
|
|
1361
|
+
comment tokens that the lexer skips over between the previously focused token
|
|
1362
|
+
and the new one. Comments are read and allocated as ``Token`` objects (and
|
|
1363
|
+
chained into the token list) but are not returned by the lexer, so counting
|
|
1364
|
+
only the returned tokens would let a comment-padded document bypass
|
|
1365
|
+
``max_tokens`` while still allocating one token per comment.
|
|
1366
|
+
"""
|
|
1367
|
+
lexer = self._lexer
|
|
1368
|
+
token = lexer.advance()
|
|
1369
|
+
# Count the comment tokens that were skipped since the previously focused
|
|
1370
|
+
# token. They are the nodes strictly between ``last_token`` and ``token`` in
|
|
1371
|
+
# the token linked-list (the lexer only ever skips comments).
|
|
1372
|
+
skipped = lexer.last_token.next
|
|
1373
|
+
while skipped is not None and skipped is not token:
|
|
1299
1374
|
self._token_counter += 1
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1375
|
+
skipped = skipped.next
|
|
1376
|
+
if token.kind is not TokenKind.EOF:
|
|
1377
|
+
self._token_counter += 1
|
|
1378
|
+
max_tokens = self._max_tokens
|
|
1379
|
+
if max_tokens is not None and self._token_counter > max_tokens:
|
|
1380
|
+
raise GraphQLSyntaxError(
|
|
1381
|
+
lexer.source,
|
|
1382
|
+
token.start,
|
|
1383
|
+
f"Document contains more than {max_tokens} tokens. Parsing aborted.",
|
|
1384
|
+
)
|
|
1308
1385
|
|
|
1309
1386
|
|
|
1310
1387
|
def get_token_desc(token: Token) -> str:
|
|
@@ -5,6 +5,7 @@ from .ast import (
|
|
|
5
5
|
MemberCoordinateNode,
|
|
6
6
|
Node,
|
|
7
7
|
DefinitionNode,
|
|
8
|
+
DirectiveExtensionNode,
|
|
8
9
|
ExecutableDefinitionNode,
|
|
9
10
|
ListValueNode,
|
|
10
11
|
ObjectValueNode,
|
|
@@ -84,7 +85,9 @@ def is_type_definition_node(node: Node) -> bool:
|
|
|
84
85
|
|
|
85
86
|
def is_type_system_extension_node(node: Node) -> bool:
|
|
86
87
|
"""Check whether the given node represents a type system extension."""
|
|
87
|
-
return isinstance(
|
|
88
|
+
return isinstance(
|
|
89
|
+
node, (SchemaExtensionNode, DirectiveExtensionNode, TypeExtensionNode)
|
|
90
|
+
)
|
|
88
91
|
|
|
89
92
|
|
|
90
93
|
def is_type_extension_node(node: Node) -> bool:
|
|
@@ -318,11 +318,12 @@ class PrintAstVisitor(Visitor):
|
|
|
318
318
|
if has_multiline_items(args)
|
|
319
319
|
else wrap("(", join(args, ", "), ")")
|
|
320
320
|
)
|
|
321
|
+
directives = wrap(" ", join(node.directives, " "))
|
|
321
322
|
repeatable = " repeatable" if node.repeatable else ""
|
|
322
323
|
locations = join(node.locations, " | ")
|
|
323
324
|
return (
|
|
324
325
|
wrap("", node.description, "\n")
|
|
325
|
-
+ f"directive @{node.name}{args}{repeatable} on {locations}"
|
|
326
|
+
+ f"directive @{node.name}{args}{directives}{repeatable} on {locations}"
|
|
326
327
|
)
|
|
327
328
|
|
|
328
329
|
@staticmethod
|
|
@@ -332,6 +333,10 @@ class PrintAstVisitor(Visitor):
|
|
|
332
333
|
" ",
|
|
333
334
|
)
|
|
334
335
|
|
|
336
|
+
@staticmethod
|
|
337
|
+
def leave_directive_extension(node: PrintedNode, *_args: Any) -> str:
|
|
338
|
+
return join((f"extend directive @{node.name}", join(node.directives, " ")), " ")
|
|
339
|
+
|
|
335
340
|
@staticmethod
|
|
336
341
|
def leave_scalar_type_extension(node: PrintedNode, *_args: Any) -> str:
|
|
337
342
|
return join(("extend scalar", node.name, join(node.directives, " ")), " ")
|
|
@@ -149,6 +149,10 @@ class Visitor:
|
|
|
149
149
|
) -> Optional[Callable[..., Optional[VisitorAction]]]:
|
|
150
150
|
"""Get the visit function for the given node kind and direction.
|
|
151
151
|
|
|
152
|
+
This deprecated compatibility helper delegates to
|
|
153
|
+
``get_enter_leave_for_kind``; call ``get_enter_leave_for_kind`` directly
|
|
154
|
+
because ``get_visit_fn`` will be removed in v3.3.
|
|
155
|
+
|
|
152
156
|
.. deprecated:: 3.2
|
|
153
157
|
Please use ``get_enter_leave_for_kind`` instead. Will be removed in v3.3.
|
|
154
158
|
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Any, Collection, Dict, Optional, Tuple, cast
|
|
2
2
|
|
|
3
3
|
from ..language import DirectiveLocation, ast
|
|
4
|
-
from ..pyutils import inspect, is_description
|
|
4
|
+
from ..pyutils import inspect, is_collection, is_description
|
|
5
5
|
from .assert_name import assert_name
|
|
6
6
|
from .definition import GraphQLArgument, GraphQLInputType, GraphQLNonNull, is_input_type
|
|
7
7
|
from .scalars import GraphQLBoolean, GraphQLString
|
|
@@ -33,9 +33,11 @@ class GraphQLDirectiveKwargs(TypedDict, total=False):
|
|
|
33
33
|
locations: Tuple[DirectiveLocation, ...]
|
|
34
34
|
args: Dict[str, GraphQLArgument]
|
|
35
35
|
is_repeatable: bool
|
|
36
|
+
deprecation_reason: Optional[str]
|
|
36
37
|
description: Optional[str]
|
|
37
38
|
extensions: Dict[str, Any]
|
|
38
39
|
ast_node: Optional[ast.DirectiveDefinitionNode]
|
|
40
|
+
extension_ast_nodes: Tuple[ast.DirectiveExtensionNode, ...]
|
|
39
41
|
|
|
40
42
|
|
|
41
43
|
class GraphQLDirective:
|
|
@@ -49,9 +51,11 @@ class GraphQLDirective:
|
|
|
49
51
|
locations: Tuple[DirectiveLocation, ...]
|
|
50
52
|
is_repeatable: bool
|
|
51
53
|
args: Dict[str, GraphQLArgument]
|
|
54
|
+
deprecation_reason: Optional[str]
|
|
52
55
|
description: Optional[str]
|
|
53
56
|
extensions: Dict[str, Any]
|
|
54
57
|
ast_node: Optional[ast.DirectiveDefinitionNode]
|
|
58
|
+
extension_ast_nodes: Tuple[ast.DirectiveExtensionNode, ...]
|
|
55
59
|
|
|
56
60
|
def __init__(
|
|
57
61
|
self,
|
|
@@ -59,9 +63,11 @@ class GraphQLDirective:
|
|
|
59
63
|
locations: Collection[DirectiveLocation],
|
|
60
64
|
args: Optional[Dict[str, GraphQLArgument]] = None,
|
|
61
65
|
is_repeatable: bool = False,
|
|
66
|
+
deprecation_reason: Optional[str] = None,
|
|
62
67
|
description: Optional[str] = None,
|
|
63
68
|
extensions: Optional[Dict[str, Any]] = None,
|
|
64
69
|
ast_node: Optional[ast.DirectiveDefinitionNode] = None,
|
|
70
|
+
extension_ast_nodes: Optional[Collection[ast.DirectiveExtensionNode]] = None,
|
|
65
71
|
) -> None:
|
|
66
72
|
assert_name(name)
|
|
67
73
|
try:
|
|
@@ -102,6 +108,8 @@ class GraphQLDirective:
|
|
|
102
108
|
}
|
|
103
109
|
if not isinstance(is_repeatable, bool):
|
|
104
110
|
raise TypeError(f"{name} is_repeatable flag must be True or False.")
|
|
111
|
+
if deprecation_reason is not None and not is_description(deprecation_reason):
|
|
112
|
+
raise TypeError(f"{name} deprecation reason must be a string.")
|
|
105
113
|
if ast_node and not isinstance(ast_node, ast.DirectiveDefinitionNode):
|
|
106
114
|
raise TypeError(f"{name} AST node must be a DirectiveDefinitionNode.")
|
|
107
115
|
if description is not None and not is_description(description):
|
|
@@ -112,13 +120,28 @@ class GraphQLDirective:
|
|
|
112
120
|
isinstance(key, str) for key in extensions
|
|
113
121
|
):
|
|
114
122
|
raise TypeError(f"{name} extensions must be a dictionary with string keys.")
|
|
123
|
+
if extension_ast_nodes:
|
|
124
|
+
if not is_collection(extension_ast_nodes) or not all(
|
|
125
|
+
isinstance(node, ast.DirectiveExtensionNode)
|
|
126
|
+
for node in extension_ast_nodes
|
|
127
|
+
):
|
|
128
|
+
raise TypeError(
|
|
129
|
+
f"{name} extension AST nodes must be specified"
|
|
130
|
+
" as a collection of DirectiveExtensionNode instances."
|
|
131
|
+
)
|
|
132
|
+
if not isinstance(extension_ast_nodes, tuple):
|
|
133
|
+
extension_ast_nodes = tuple(extension_ast_nodes)
|
|
134
|
+
else:
|
|
135
|
+
extension_ast_nodes = ()
|
|
115
136
|
self.name = name
|
|
116
137
|
self.locations = locations
|
|
117
138
|
self.args = args
|
|
118
139
|
self.is_repeatable = is_repeatable
|
|
140
|
+
self.deprecation_reason = deprecation_reason
|
|
119
141
|
self.description = description
|
|
120
142
|
self.extensions = extensions
|
|
121
143
|
self.ast_node = ast_node
|
|
144
|
+
self.extension_ast_nodes = extension_ast_nodes
|
|
122
145
|
|
|
123
146
|
def __str__(self) -> str:
|
|
124
147
|
return f"@{self.name}"
|
|
@@ -133,6 +156,7 @@ class GraphQLDirective:
|
|
|
133
156
|
and self.locations == other.locations
|
|
134
157
|
and self.args == other.args
|
|
135
158
|
and self.is_repeatable == other.is_repeatable
|
|
159
|
+
and self.deprecation_reason == other.deprecation_reason
|
|
136
160
|
and self.description == other.description
|
|
137
161
|
and self.extensions == other.extensions
|
|
138
162
|
)
|
|
@@ -143,9 +167,11 @@ class GraphQLDirective:
|
|
|
143
167
|
locations=self.locations,
|
|
144
168
|
args=self.args,
|
|
145
169
|
is_repeatable=self.is_repeatable,
|
|
170
|
+
deprecation_reason=self.deprecation_reason,
|
|
146
171
|
description=self.description,
|
|
147
172
|
extensions=self.extensions,
|
|
148
173
|
ast_node=self.ast_node,
|
|
174
|
+
extension_ast_nodes=self.extension_ast_nodes,
|
|
149
175
|
)
|
|
150
176
|
|
|
151
177
|
def __copy__(self) -> "GraphQLDirective": # pragma: no cover
|
|
@@ -210,6 +236,7 @@ GraphQLDeprecatedDirective = GraphQLDirective(
|
|
|
210
236
|
DirectiveLocation.ARGUMENT_DEFINITION,
|
|
211
237
|
DirectiveLocation.INPUT_FIELD_DEFINITION,
|
|
212
238
|
DirectiveLocation.ENUM_VALUE,
|
|
239
|
+
DirectiveLocation.DIRECTIVE_DEFINITION,
|
|
213
240
|
],
|
|
214
241
|
args={
|
|
215
242
|
"reason": GraphQLArgument(
|