graphql-core 3.2.13__tar.gz → 3.2.14__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.
Files changed (359) hide show
  1. {graphql_core-3.2.13 → graphql_core-3.2.14}/.bumpversion.cfg +1 -1
  2. {graphql_core-3.2.13 → graphql_core-3.2.14}/PKG-INFO +2 -2
  3. {graphql_core-3.2.13 → graphql_core-3.2.14}/README.md +1 -1
  4. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/conf.py +1 -1
  5. {graphql_core-3.2.13 → graphql_core-3.2.14}/pyproject.toml +1 -1
  6. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/error/graphql_error.py +11 -9
  7. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/execution/collect_fields.py +15 -2
  8. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/execution/execute.py +65 -31
  9. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/execution/map_async_iterator.py +4 -1
  10. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/execution/subscribe.py +16 -0
  11. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/execution/values.py +49 -7
  12. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/graphql.py +11 -1
  13. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/ast.py +4 -1
  14. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/block_string.py +7 -2
  15. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/lexer.py +31 -0
  16. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/location.py +36 -2
  17. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/parser.py +301 -61
  18. graphql_core-3.2.14/src/graphql/language/printer.py +517 -0
  19. graphql_core-3.2.14/src/graphql/language/reducer.py +78 -0
  20. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/source.py +9 -9
  21. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/type/definition.py +23 -10
  22. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/type/scalars.py +14 -7
  23. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/build_ast_schema.py +19 -1
  24. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/coerce_input_value.py +29 -6
  25. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/fields_on_correct_type.py +10 -2
  26. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/known_argument_names.py +20 -9
  27. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/known_type_names.py +14 -7
  28. graphql_core-3.2.14/src/graphql/validation/rules/max_introspection_depth_rule.py +146 -0
  29. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/no_unused_fragments.py +4 -6
  30. graphql_core-3.2.14/src/graphql/validation/rules/overlapping_fields_can_be_merged.py +1088 -0
  31. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/single_field_subscriptions.py +33 -8
  32. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/values_of_correct_type.py +21 -7
  33. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/validate.py +147 -14
  34. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/validation_context.py +123 -22
  35. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/version.py +2 -2
  36. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql_core.egg-info/PKG-INFO +2 -2
  37. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql_core.egg-info/SOURCES.txt +7 -0
  38. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/conftest.py +17 -0
  39. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/error/test_graphql_error.py +16 -4
  40. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/error/test_print_location.py +12 -0
  41. graphql_core-3.2.14/tests/execution/test_abstract_type_promises.py +52 -0
  42. graphql_core-3.2.14/tests/execution/test_collect_fields.py +42 -0
  43. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_map_async_iterator.py +24 -0
  44. graphql_core-3.2.14/tests/execution/test_too_deeply_nested_selections.py +138 -0
  45. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_variables.py +170 -2
  46. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_block_string.py +6 -0
  47. graphql_core-3.2.14/tests/language/test_location.py +217 -0
  48. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_parser.py +431 -2
  49. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_printer.py +85 -1
  50. graphql_core-3.2.14/tests/language/test_reducer.py +101 -0
  51. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_source.py +12 -0
  52. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_visitor.py +6 -0
  53. graphql_core-3.2.14/tests/test_hide_suggestions.py +140 -0
  54. graphql_core-3.2.14/tests/test_too_deeply_nested_documents.py +68 -0
  55. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/type/test_enum.py +25 -2
  56. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/type/test_scalars.py +32 -1
  57. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_build_ast_schema.py +61 -0
  58. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_coerce_input_value.py +58 -4
  59. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/harness.py +2 -1
  60. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_fields_on_correct_type.py +16 -0
  61. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_known_argument_names.py +29 -0
  62. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_known_type_names.py +24 -0
  63. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_max_introspection_depth_rule.py +238 -1
  64. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_no_undefined_variables.py +41 -0
  65. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_overlapping_fields_can_be_merged.py +671 -36
  66. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_single_field_subscriptions.py +66 -1
  67. graphql_core-3.2.14/tests/validation/test_validation.py +561 -0
  68. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_values_of_correct_type.py +59 -0
  69. {graphql_core-3.2.13 → graphql_core-3.2.14}/tox.ini +7 -6
  70. graphql_core-3.2.13/src/graphql/language/printer.py +0 -474
  71. graphql_core-3.2.13/src/graphql/validation/rules/max_introspection_depth_rule.py +0 -102
  72. graphql_core-3.2.13/src/graphql/validation/rules/overlapping_fields_can_be_merged.py +0 -915
  73. graphql_core-3.2.13/tests/language/test_location.py +0 -43
  74. graphql_core-3.2.13/tests/validation/test_validation.py +0 -213
  75. {graphql_core-3.2.13 → graphql_core-3.2.14}/.coveragerc +0 -0
  76. {graphql_core-3.2.13 → graphql_core-3.2.14}/.editorconfig +0 -0
  77. {graphql_core-3.2.13 → graphql_core-3.2.14}/.flake8 +0 -0
  78. {graphql_core-3.2.13 → graphql_core-3.2.14}/.mypy.ini +0 -0
  79. {graphql_core-3.2.13 → graphql_core-3.2.14}/.readthedocs.yaml +0 -0
  80. {graphql_core-3.2.13 → graphql_core-3.2.14}/CODEOWNERS +0 -0
  81. {graphql_core-3.2.13 → graphql_core-3.2.14}/LICENSE +0 -0
  82. {graphql_core-3.2.13 → graphql_core-3.2.14}/MANIFEST.in +0 -0
  83. {graphql_core-3.2.13 → graphql_core-3.2.14}/SECURITY.md +0 -0
  84. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/Makefile +0 -0
  85. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/diffs.rst +0 -0
  86. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/index.rst +0 -0
  87. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/intro.rst +0 -0
  88. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/make.bat +0 -0
  89. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/modules/error.rst +0 -0
  90. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/modules/execution.rst +0 -0
  91. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/modules/graphql.rst +0 -0
  92. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/modules/language.rst +0 -0
  93. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/modules/pyutils.rst +0 -0
  94. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/modules/type.rst +0 -0
  95. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/modules/utilities.rst +0 -0
  96. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/modules/validation.rst +0 -0
  97. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/requirements.txt +0 -0
  98. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/usage/extension.rst +0 -0
  99. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/usage/index.rst +0 -0
  100. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/usage/introspection.rst +0 -0
  101. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/usage/methods.rst +0 -0
  102. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/usage/other.rst +0 -0
  103. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/usage/parser.rst +0 -0
  104. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/usage/queries.rst +0 -0
  105. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/usage/resolvers.rst +0 -0
  106. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/usage/schema.rst +0 -0
  107. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/usage/sdl.rst +0 -0
  108. {graphql_core-3.2.13 → graphql_core-3.2.14}/docs/usage/validator.rst +0 -0
  109. {graphql_core-3.2.13 → graphql_core-3.2.14}/poetry.lock +0 -0
  110. {graphql_core-3.2.13 → graphql_core-3.2.14}/setup.cfg +0 -0
  111. {graphql_core-3.2.13 → graphql_core-3.2.14}/setup.py +0 -0
  112. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/__init__.py +0 -0
  113. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/error/__init__.py +0 -0
  114. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/error/located_error.py +0 -0
  115. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/error/syntax_error.py +0 -0
  116. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/execution/__init__.py +0 -0
  117. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/execution/middleware.py +0 -0
  118. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/__init__.py +0 -0
  119. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/character_classes.py +0 -0
  120. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/directive_locations.py +0 -0
  121. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/predicates.py +0 -0
  122. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/print_location.py +0 -0
  123. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/print_string.py +0 -0
  124. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/schema_coordinate_lexer.py +0 -0
  125. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/token_kind.py +0 -0
  126. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/language/visitor.py +0 -0
  127. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/py.typed +0 -0
  128. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/__init__.py +0 -0
  129. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/awaitable_or_value.py +0 -0
  130. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/cached_property.py +0 -0
  131. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/convert_case.py +0 -0
  132. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/description.py +0 -0
  133. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/did_you_mean.py +0 -0
  134. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/frozen_dict.py +0 -0
  135. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/frozen_error.py +0 -0
  136. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/frozen_list.py +0 -0
  137. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/group_by.py +0 -0
  138. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/identity_func.py +0 -0
  139. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/inspect.py +0 -0
  140. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/is_awaitable.py +0 -0
  141. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/is_iterable.py +0 -0
  142. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/merge_kwargs.py +0 -0
  143. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/natural_compare.py +0 -0
  144. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/path.py +0 -0
  145. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/print_path_list.py +0 -0
  146. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/simple_pub_sub.py +0 -0
  147. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/suggestion_list.py +0 -0
  148. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/pyutils/undefined.py +0 -0
  149. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/subscription/__init__.py +0 -0
  150. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/type/__init__.py +0 -0
  151. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/type/assert_name.py +0 -0
  152. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/type/directives.py +0 -0
  153. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/type/introspection.py +0 -0
  154. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/type/schema.py +0 -0
  155. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/type/validate.py +0 -0
  156. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/__init__.py +0 -0
  157. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/assert_valid_name.py +0 -0
  158. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/ast_from_value.py +0 -0
  159. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/ast_to_dict.py +0 -0
  160. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/build_client_schema.py +0 -0
  161. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/concat_ast.py +0 -0
  162. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/extend_schema.py +0 -0
  163. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/find_breaking_changes.py +0 -0
  164. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/get_introspection_query.py +0 -0
  165. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/get_operation_ast.py +0 -0
  166. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/get_operation_root_type.py +0 -0
  167. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/introspection_from_schema.py +0 -0
  168. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/lexicographic_sort_schema.py +0 -0
  169. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/print_schema.py +0 -0
  170. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/resolve_schema_coordinate.py +0 -0
  171. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/separate_operations.py +0 -0
  172. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/sort_value_node.py +0 -0
  173. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/strip_ignored_characters.py +0 -0
  174. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/type_comparators.py +0 -0
  175. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/type_from_ast.py +0 -0
  176. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/type_info.py +0 -0
  177. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/value_from_ast.py +0 -0
  178. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/utilities/value_from_ast_untyped.py +0 -0
  179. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/__init__.py +0 -0
  180. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/__init__.py +0 -0
  181. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/custom/__init__.py +0 -0
  182. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/custom/no_deprecated.py +0 -0
  183. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/custom/no_schema_introspection.py +0 -0
  184. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/executable_definitions.py +0 -0
  185. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/fragments_on_composite_types.py +0 -0
  186. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/known_directives.py +0 -0
  187. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/known_fragment_names.py +0 -0
  188. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/lone_anonymous_operation.py +0 -0
  189. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/lone_schema_definition.py +0 -0
  190. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/no_fragment_cycles.py +0 -0
  191. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/no_undefined_variables.py +0 -0
  192. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/no_unused_variables.py +0 -0
  193. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/possible_fragment_spreads.py +0 -0
  194. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/possible_type_extensions.py +0 -0
  195. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/provided_required_arguments.py +0 -0
  196. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/scalar_leafs.py +0 -0
  197. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/unique_argument_definition_names.py +0 -0
  198. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/unique_argument_names.py +0 -0
  199. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/unique_directive_names.py +0 -0
  200. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/unique_directives_per_location.py +0 -0
  201. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/unique_enum_value_names.py +0 -0
  202. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/unique_field_definition_names.py +0 -0
  203. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/unique_fragment_names.py +0 -0
  204. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/unique_input_field_names.py +0 -0
  205. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/unique_operation_names.py +0 -0
  206. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/unique_operation_types.py +0 -0
  207. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/unique_type_names.py +0 -0
  208. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/unique_variable_names.py +0 -0
  209. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/variables_are_input_types.py +0 -0
  210. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/rules/variables_in_allowed_position.py +0 -0
  211. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql/validation/specified_rules.py +0 -0
  212. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql_core.egg-info/dependency_links.txt +0 -0
  213. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql_core.egg-info/not-zip-safe +0 -0
  214. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql_core.egg-info/requires.txt +0 -0
  215. {graphql_core-3.2.13 → graphql_core-3.2.14}/src/graphql_core.egg-info/top_level.txt +0 -0
  216. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/__init__.py +0 -0
  217. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/benchmarks/__init__.py +0 -0
  218. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/benchmarks/test_build_ast_schema.py +0 -0
  219. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/benchmarks/test_build_client_schema.py +0 -0
  220. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/benchmarks/test_execution_async.py +0 -0
  221. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/benchmarks/test_execution_sync.py +0 -0
  222. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/benchmarks/test_introspection_from_schema.py +0 -0
  223. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/benchmarks/test_parser.py +0 -0
  224. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/benchmarks/test_print.py +0 -0
  225. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/benchmarks/test_repeated_fields.py +0 -0
  226. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/benchmarks/test_validate_gql.py +0 -0
  227. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/benchmarks/test_validate_invalid_gql.py +0 -0
  228. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/benchmarks/test_validate_sdl.py +0 -0
  229. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/benchmarks/test_visit.py +0 -0
  230. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/error/__init__.py +0 -0
  231. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/error/test_located_error.py +0 -0
  232. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/__init__.py +0 -0
  233. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_abstract.py +0 -0
  234. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_customize.py +0 -0
  235. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_directives.py +0 -0
  236. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_execution_result.py +0 -0
  237. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_executor.py +0 -0
  238. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_lists.py +0 -0
  239. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_middleware.py +0 -0
  240. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_mutations.py +0 -0
  241. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_nonnull.py +0 -0
  242. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_one_of.py +0 -0
  243. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_parallel.py +0 -0
  244. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_resolve.py +0 -0
  245. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_schema.py +0 -0
  246. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_subscribe.py +0 -0
  247. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_sync.py +0 -0
  248. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/execution/test_union_interface.py +0 -0
  249. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/fixtures/__init__.py +0 -0
  250. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/fixtures/github_schema.graphql +0 -0
  251. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/fixtures/github_schema.json +0 -0
  252. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/fixtures/kitchen_sink.graphql +0 -0
  253. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/fixtures/schema_kitchen_sink.graphql +0 -0
  254. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/__init__.py +0 -0
  255. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_ast.py +0 -0
  256. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_block_string_fuzz.py +0 -0
  257. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_character_classes.py +0 -0
  258. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_lexer.py +0 -0
  259. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_predicates.py +0 -0
  260. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_print_string.py +0 -0
  261. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_schema_coordinate_lexer.py +0 -0
  262. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_schema_parser.py +0 -0
  263. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/language/test_schema_printer.py +0 -0
  264. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/__init__.py +0 -0
  265. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_cached_property.py +0 -0
  266. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_convert_case.py +0 -0
  267. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_description.py +0 -0
  268. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_did_you_mean.py +0 -0
  269. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_frozen_dict.py +0 -0
  270. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_frozen_error.py +0 -0
  271. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_frozen_list.py +0 -0
  272. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_group_by.py +0 -0
  273. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_identity_func.py +0 -0
  274. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_inspect.py +0 -0
  275. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_is_awaitable.py +0 -0
  276. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_is_iterable.py +0 -0
  277. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_merge_kwargs.py +0 -0
  278. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_natural_compare.py +0 -0
  279. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_path.py +0 -0
  280. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_print_path_list.py +0 -0
  281. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_simple_pub_sub.py +0 -0
  282. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_suggestion_list.py +0 -0
  283. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/pyutils/test_undefined.py +0 -0
  284. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/star_wars_data.py +0 -0
  285. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/star_wars_schema.py +0 -0
  286. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/test_docs.py +0 -0
  287. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/test_star_wars_introspection.py +0 -0
  288. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/test_star_wars_query.py +0 -0
  289. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/test_star_wars_validation.py +0 -0
  290. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/test_user_registry.py +0 -0
  291. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/test_version.py +0 -0
  292. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/type/__init__.py +0 -0
  293. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/type/test_assert_name.py +0 -0
  294. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/type/test_custom_scalars.py +0 -0
  295. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/type/test_definition.py +0 -0
  296. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/type/test_directives.py +0 -0
  297. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/type/test_extensions.py +0 -0
  298. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/type/test_introspection.py +0 -0
  299. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/type/test_predicate.py +0 -0
  300. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/type/test_schema.py +0 -0
  301. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/type/test_validation.py +0 -0
  302. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/__init__.py +0 -0
  303. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_ast_from_value.py +0 -0
  304. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_ast_to_dict.py +0 -0
  305. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_build_client_schema.py +0 -0
  306. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_concat_ast.py +0 -0
  307. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_extend_schema.py +0 -0
  308. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_find_breaking_changes.py +0 -0
  309. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_get_introspection_query.py +0 -0
  310. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_get_operation_ast.py +0 -0
  311. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_get_operation_root_type.py +0 -0
  312. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_introspection_from_schema.py +0 -0
  313. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_lexicographic_sort_schema.py +0 -0
  314. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_print_schema.py +0 -0
  315. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_resolve_schema_coordinate.py +0 -0
  316. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_separate_operations.py +0 -0
  317. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_sort_value_node.py +0 -0
  318. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_strip_ignored_characters.py +0 -0
  319. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_strip_ignored_characters_fuzz.py +0 -0
  320. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_type_comparators.py +0 -0
  321. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_type_from_ast.py +0 -0
  322. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_type_info.py +0 -0
  323. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_value_from_ast.py +0 -0
  324. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utilities/test_value_from_ast_untyped.py +0 -0
  325. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utils/__init__.py +0 -0
  326. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utils/dedent.py +0 -0
  327. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utils/gen_fuzz_strings.py +0 -0
  328. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utils/test_dedent.py +0 -0
  329. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/utils/test_gen_fuzz_strings.py +0 -0
  330. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/__init__.py +0 -0
  331. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_executable_definitions.py +0 -0
  332. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_fragments_on_composite_types.py +0 -0
  333. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_known_directives.py +0 -0
  334. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_known_fragment_names.py +0 -0
  335. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_lone_anonymous_operation.py +0 -0
  336. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_lone_schema_definition.py +0 -0
  337. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_no_deprecated.py +0 -0
  338. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_no_fragment_cycles.py +0 -0
  339. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_no_schema_introspection.py +0 -0
  340. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_no_unused_fragments.py +0 -0
  341. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_no_unused_variables.py +0 -0
  342. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_possible_fragment_spreads.py +0 -0
  343. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_possible_type_extensions.py +0 -0
  344. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_provided_required_arguments.py +0 -0
  345. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_scalar_leafs.py +0 -0
  346. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_unique_argument_definition_names.py +0 -0
  347. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_unique_argument_names.py +0 -0
  348. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_unique_directive_names.py +0 -0
  349. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_unique_directives_per_location.py +0 -0
  350. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_unique_enum_value_names.py +0 -0
  351. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_unique_field_definition_names.py +0 -0
  352. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_unique_fragment_names.py +0 -0
  353. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_unique_input_field_names.py +0 -0
  354. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_unique_operation_names.py +0 -0
  355. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_unique_operation_types.py +0 -0
  356. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_unique_type_names.py +0 -0
  357. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_unique_variable_names.py +0 -0
  358. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_variables_are_input_types.py +0 -0
  359. {graphql_core-3.2.13 → graphql_core-3.2.14}/tests/validation/test_variables_in_allowed_position.py +0 -0
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 3.2.13
2
+ current_version = 3.2.14
3
3
  commit = False
4
4
  tag = False
5
5
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graphql-core
3
- Version: 3.2.13
3
+ Version: 3.2.14
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
@@ -51,7 +51,7 @@ a query language for APIs created by Facebook.
51
51
  ![Lint Status](https://github.com/graphql-python/graphql-core/actions/workflows/lint.yml/badge.svg)
52
52
  [![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
53
53
 
54
- The current version 3.2.13 of GraphQL-core is up-to-date with GraphQL.js version 16.14.2.
54
+ The current version 3.2.14 of GraphQL-core is up-to-date with GraphQL.js version 16.15.0.
55
55
 
56
56
  An extensive test suite with over 2500 unit tests and 100% coverage comprises a
57
57
  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
  ![Lint Status](https://github.com/graphql-python/graphql-core/actions/workflows/lint.yml/badge.svg)
11
11
  [![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
12
12
 
13
- The current version 3.2.13 of GraphQL-core is up-to-date with GraphQL.js version 16.14.2.
13
+ The current version 3.2.14 of GraphQL-core is up-to-date with GraphQL.js version 16.15.0.
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.13"
64
+ version = release = "3.2.14"
65
65
 
66
66
  # The language for content autogenerated by Sphinx. Refer to documentation
67
67
  # for a list of supported languages.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "graphql-core"
3
- version = "3.2.13"
3
+ version = "3.2.14"
4
4
  description = """
5
5
  GraphQL-core is a Python port of GraphQL.js, \
6
6
  the JavaScript reference implementation for GraphQL."""
@@ -1,6 +1,5 @@
1
1
  """GraphQL Error"""
2
2
 
3
- from sys import exc_info
4
3
  from typing import Any, Collection, Dict, List, Optional, Union, TYPE_CHECKING
5
4
 
6
5
  try:
@@ -246,13 +245,18 @@ class GraphQLError(Exception):
246
245
  if not positions and node_locations:
247
246
  positions = [loc.start for loc in node_locations]
248
247
  self.positions = positions or None
249
- if positions and source:
250
- locations: Optional[List["SourceLocation"]] = [
251
- source.get_location(pos) for pos in positions
252
- ]
248
+ source_positions = (
249
+ [(source, pos) for pos in positions]
250
+ if positions and source
251
+ else [(loc.source, loc.start) for loc in node_locations]
252
+ )
253
+ if source_positions:
254
+ # Lazy import to avoid a cyclic dependency between error and language
255
+ from ..language.location import get_locations
256
+
257
+ self.locations = get_locations(source_positions)
253
258
  else:
254
- locations = [loc.source.get_location(loc.start) for loc in node_locations]
255
- self.locations = locations or None
259
+ self.locations = None
256
260
 
257
261
  if original_error:
258
262
  self.__traceback__ = original_error.__traceback__
@@ -265,8 +269,6 @@ class GraphQLError(Exception):
265
269
  if isinstance(original_extensions, dict):
266
270
  extensions = original_extensions
267
271
  self.extensions = extensions or {}
268
- if not self.__traceback__:
269
- self.__traceback__ = exc_info()[2]
270
272
 
271
273
  def __str__(self) -> str:
272
274
  """Get this error as a human-readable message with source locations.
@@ -1,6 +1,6 @@
1
1
  """Collect fields"""
2
2
 
3
- from typing import Any, Dict, List, Set, Union, cast
3
+ from typing import Any, Callable, Dict, List, Optional, Set, Union, cast
4
4
 
5
5
  from ..language import (
6
6
  FieldNode,
@@ -29,6 +29,7 @@ def collect_fields(
29
29
  variable_values: Dict[str, Any],
30
30
  runtime_type: GraphQLObjectType,
31
31
  selection_set: SelectionSetNode,
32
+ on_selection_set: Optional[Callable[[SelectionSetNode], None]] = None,
32
33
  ) -> Dict[str, List[FieldNode]]:
33
34
  """Collect fields.
34
35
 
@@ -44,7 +45,14 @@ def collect_fields(
44
45
  """
45
46
  fields: Dict[str, List[FieldNode]] = {}
46
47
  collect_fields_impl(
47
- schema, fragments, variable_values, runtime_type, selection_set, fields, set()
48
+ schema,
49
+ fragments,
50
+ variable_values,
51
+ runtime_type,
52
+ selection_set,
53
+ fields,
54
+ set(),
55
+ on_selection_set,
48
56
  )
49
57
  return fields
50
58
 
@@ -93,11 +101,14 @@ def collect_fields_impl(
93
101
  selection_set: SelectionSetNode,
94
102
  fields: Dict[str, List[FieldNode]],
95
103
  visited_fragment_names: Set[str],
104
+ on_selection_set: Optional[Callable[[SelectionSetNode], None]] = None,
96
105
  ) -> None:
97
106
  """Collect fields (internal implementation).
98
107
 
99
108
  :meta private:
100
109
  """
110
+ if on_selection_set:
111
+ on_selection_set(selection_set)
101
112
  for selection in selection_set.selections:
102
113
  if isinstance(selection, FieldNode):
103
114
  if not should_include_node(variable_values, selection):
@@ -117,6 +128,7 @@ def collect_fields_impl(
117
128
  selection.selection_set,
118
129
  fields,
119
130
  visited_fragment_names,
131
+ on_selection_set,
120
132
  )
121
133
  elif isinstance(selection, FragmentSpreadNode): # pragma: no cover else
122
134
  frag_name = selection.name.value
@@ -138,6 +150,7 @@ def collect_fields_impl(
138
150
  fragment.selection_set,
139
151
  fields,
140
152
  visited_fragment_names,
153
+ on_selection_set,
141
154
  )
142
155
 
143
156
 
@@ -12,6 +12,7 @@ from typing import (
12
12
  Dict,
13
13
  Iterable,
14
14
  List,
15
+ NoReturn,
15
16
  Optional,
16
17
  Set,
17
18
  Tuple,
@@ -82,6 +83,8 @@ __all__ = [
82
83
  "Middleware",
83
84
  ]
84
85
 
86
+ SELECTIONS_NESTED_TOO_DEEPLY = "Selections are nested too deeply. Execution aborted."
87
+
85
88
 
86
89
  # Terminology
87
90
  #
@@ -377,6 +380,7 @@ class ExecutionContext:
377
380
  max_coercion_errors: int = 50,
378
381
  middleware: Optional[Middleware] = None,
379
382
  is_awaitable: Optional[Callable[[Any], bool]] = None,
383
+ hide_suggestions: bool = False,
380
384
  ) -> Union[List[GraphQLError], "ExecutionContext"]:
381
385
  """Build an execution context
382
386
 
@@ -430,6 +434,7 @@ class ExecutionContext:
430
434
  operation.variable_definitions or (),
431
435
  raw_variable_values or {},
432
436
  max_errors=max_coercion_errors,
437
+ hide_suggestions=hide_suggestions,
433
438
  )
434
439
 
435
440
  if isinstance(coerced_variable_values, list):
@@ -487,13 +492,20 @@ class ExecutionContext:
487
492
  operation,
488
493
  )
489
494
 
490
- root_fields = collect_fields(
491
- self.schema,
492
- self.fragments,
493
- self.variable_values,
494
- root_type,
495
- operation.selection_set,
496
- )
495
+ try:
496
+ root_fields = collect_fields(
497
+ self.schema,
498
+ self.fragments,
499
+ self.variable_values,
500
+ root_type,
501
+ operation.selection_set,
502
+ )
503
+ except RecursionError:
504
+ root_fields = None
505
+ # Leave the block above first, or the RecursionError would be kept as the
506
+ # context of this error and keep all the frames of the recursion alive.
507
+ if root_fields is None:
508
+ raise GraphQLError(SELECTIONS_NESTED_TOO_DEEPLY, operation)
497
509
 
498
510
  path = None
499
511
 
@@ -619,7 +631,7 @@ class ExecutionContext:
619
631
 
620
632
  :meta private:
621
633
  """
622
- # The resolve function's first argument is a collection of information about
634
+ # The resolve function's second argument is a collection of information about
623
635
  # the current execution state.
624
636
  return GraphQLResolveInfo(
625
637
  field_nodes[0].name.value,
@@ -1160,6 +1172,7 @@ def execute(
1160
1172
  middleware: Optional[Middleware] = None,
1161
1173
  execution_context_class: Optional[Type["ExecutionContext"]] = None,
1162
1174
  is_awaitable: Optional[Callable[[Any], bool]] = None,
1175
+ hide_suggestions: bool = False,
1163
1176
  ) -> AwaitableOrValue[ExecutionResult]:
1164
1177
  """Execute a GraphQL operation.
1165
1178
 
@@ -1195,6 +1208,7 @@ def execute(
1195
1208
  context.
1196
1209
  :param is_awaitable: The predicate to be used for checking whether values are
1197
1210
  awaitable.
1211
+ :param hide_suggestions: Omit suggestions from input coercion errors.
1198
1212
  :returns: A completed execution result, or a coroutine object yielding one when
1199
1213
  execution is asynchronous.
1200
1214
 
@@ -1305,6 +1319,11 @@ def execute(
1305
1319
 
1306
1320
  # If a valid execution context cannot be created due to incorrect arguments,
1307
1321
  # a "Response" with only errors is returned.
1322
+ # Pass this option only when it is set, so that subclasses
1323
+ # overriding the build method with a fixed signature keep working.
1324
+ build_options: Dict[str, Any] = (
1325
+ {"hide_suggestions": True} if hide_suggestions else {}
1326
+ )
1308
1327
  exe_context = execution_context_class.build(
1309
1328
  schema,
1310
1329
  document,
@@ -1318,6 +1337,7 @@ def execute(
1318
1337
  max_coercion_errors,
1319
1338
  middleware,
1320
1339
  is_awaitable,
1340
+ **build_options,
1321
1341
  )
1322
1342
 
1323
1343
  # Return early errors if execution context failed.
@@ -1380,6 +1400,7 @@ def execute_sync(
1380
1400
  middleware: Optional[Middleware] = None,
1381
1401
  execution_context_class: Optional[Type["ExecutionContext"]] = None,
1382
1402
  check_sync: bool = False,
1403
+ hide_suggestions: bool = False,
1383
1404
  ) -> ExecutionResult:
1384
1405
  """Execute a GraphQL operation synchronously.
1385
1406
 
@@ -1406,6 +1427,7 @@ def execute_sync(
1406
1427
  context.
1407
1428
  :param check_sync: Set this to ``True`` to still run checks that no awaitable
1408
1429
  values are returned. By default, everything is assumed to be synchronous.
1430
+ :param hide_suggestions: Omit suggestions from input coercion errors.
1409
1431
  :returns: The completed execution result for a synchronous operation.
1410
1432
 
1411
1433
  Execute an operation synchronously when all resolvers are synchronous:
@@ -1433,13 +1455,13 @@ def execute_sync(
1433
1455
  ... schema, document, {'greeting': greeting}, check_sync=True
1434
1456
  ... )
1435
1457
  ... except RuntimeError as error:
1436
- ... return error
1458
+ ... return str(error)
1437
1459
  >>> with warnings.catch_warnings():
1438
1460
  ... warnings.simplefilter('ignore', RuntimeWarning)
1439
- ... error = asyncio.run(main())
1461
+ ... message = asyncio.run(main())
1440
1462
  ... _ = gc.collect()
1441
- >>> error
1442
- RuntimeError('GraphQL execution failed to complete synchronously.')
1463
+ >>> message
1464
+ 'GraphQL execution failed to complete synchronously.'
1443
1465
  """
1444
1466
  is_awaitable = (
1445
1467
  check_sync
@@ -1461,6 +1483,7 @@ def execute_sync(
1461
1483
  middleware,
1462
1484
  execution_context_class,
1463
1485
  is_awaitable,
1486
+ hide_suggestions,
1464
1487
  )
1465
1488
 
1466
1489
  # Assert that the execution was synchronous.
@@ -1621,25 +1644,36 @@ def default_type_resolver(
1621
1644
  awaitable_types: List[GraphQLObjectType] = []
1622
1645
  append_awaitable_types = awaitable_types.append
1623
1646
 
1624
- for type_ in possible_types:
1625
- if type_.is_type_of:
1626
- is_type_of_result = type_.is_type_of(value, info)
1627
-
1628
- if is_awaitable(is_type_of_result):
1629
- append_awaitable_results(cast(Awaitable, is_type_of_result))
1630
- append_awaitable_types(type_)
1631
- elif is_type_of_result:
1632
- if awaitable_is_type_of_results:
1633
- # noinspection PyShadowingNames
1634
- async def await_is_type_of_and_return_type(
1635
- resolved_type_name: str = type_.name,
1636
- ) -> str:
1637
- with suppress(Exception):
1638
- await gather(*awaitable_is_type_of_results)
1639
- return resolved_type_name
1640
-
1641
- return await_is_type_of_and_return_type()
1642
- return type_.name
1647
+ try:
1648
+ for type_ in possible_types:
1649
+ if type_.is_type_of:
1650
+ is_type_of_result = type_.is_type_of(value, info)
1651
+
1652
+ if is_awaitable(is_type_of_result):
1653
+ append_awaitable_results(cast(Awaitable, is_type_of_result))
1654
+ append_awaitable_types(type_)
1655
+ elif is_type_of_result:
1656
+ if awaitable_is_type_of_results:
1657
+ # noinspection PyShadowingNames
1658
+ async def await_is_type_of_and_return_type(
1659
+ resolved_type_name: str = type_.name,
1660
+ ) -> str:
1661
+ with suppress(Exception):
1662
+ await gather(*awaitable_is_type_of_results)
1663
+ return resolved_type_name
1664
+
1665
+ return await_is_type_of_and_return_type()
1666
+ return type_.name
1667
+ except Exception as error:
1668
+ if awaitable_is_type_of_results:
1669
+ # Settle the pending isTypeOf results so that their errors can be
1670
+ # observed before they would be orphaned.
1671
+ async def settle_and_raise(error: Exception = error) -> NoReturn:
1672
+ await gather(*awaitable_is_type_of_results, return_exceptions=True)
1673
+ raise error
1674
+
1675
+ return settle_and_raise()
1676
+ raise
1643
1677
 
1644
1678
  if awaitable_is_type_of_results:
1645
1679
  # noinspection PyShadowingNames
@@ -2,6 +2,7 @@
2
2
 
3
3
  from asyncio import CancelledError, Event, Task, ensure_future, wait
4
4
  from concurrent.futures import FIRST_COMPLETED
5
+ from contextlib import suppress
5
6
  from inspect import isasyncgen, isawaitable
6
7
  from types import TracebackType
7
8
  from typing import Any, AsyncIterable, Callable, Optional, Set, Type, Union
@@ -118,7 +119,9 @@ class MapAsyncIterator:
118
119
  if athrow:
119
120
  await athrow(type_ if value is None else value)
120
121
  else:
121
- await self.aclose()
122
+ # Keep the original error when closing the source also fails.
123
+ with suppress(Exception):
124
+ await self.aclose()
122
125
  if value is None:
123
126
  if traceback is None:
124
127
  raise type_ # pragma: no cover
@@ -13,6 +13,7 @@ from typing import (
13
13
  from ..error import GraphQLError, located_error
14
14
  from ..execution.collect_fields import collect_fields
15
15
  from ..execution.execute import (
16
+ SELECTIONS_NESTED_TOO_DEEPLY,
16
17
  assert_valid_execution_arguments,
17
18
  execute,
18
19
  get_field_def,
@@ -38,6 +39,7 @@ async def subscribe(
38
39
  field_resolver: Optional[GraphQLFieldResolver] = None,
39
40
  subscribe_field_resolver: Optional[GraphQLFieldResolver] = None,
40
41
  max_coercion_errors: int = 50,
42
+ hide_suggestions: bool = False,
41
43
  ) -> Union[AsyncIterator[ExecutionResult], ExecutionResult]:
42
44
  """Create a GraphQL subscription.
43
45
 
@@ -74,6 +76,7 @@ async def subscribe(
74
76
  :param subscribe_field_resolver: Resolver used for the root subscription field.
75
77
  :param max_coercion_errors: Set the maximum number of errors allowed for coercing
76
78
  variable values (defaults to 50).
79
+ :param hide_suggestions: Omit suggestions from input coercion errors.
77
80
  :returns: A source stream mapped to execution results, or an execution result
78
81
  containing subscription errors.
79
82
 
@@ -161,6 +164,7 @@ async def subscribe(
161
164
  operation_name,
162
165
  subscribe_field_resolver,
163
166
  max_coercion_errors,
167
+ hide_suggestions,
164
168
  )
165
169
  if isinstance(result_or_stream, ExecutionResult):
166
170
  return result_or_stream
@@ -183,6 +187,7 @@ async def subscribe(
183
187
  variable_values,
184
188
  operation_name,
185
189
  field_resolver,
190
+ hide_suggestions=hide_suggestions,
186
191
  )
187
192
  return await result if isawaitable(result) else result
188
193
 
@@ -199,6 +204,7 @@ async def create_source_event_stream(
199
204
  operation_name: Optional[str] = None,
200
205
  subscribe_field_resolver: Optional[GraphQLFieldResolver] = None,
201
206
  max_coercion_errors: int = 50,
207
+ hide_suggestions: bool = False,
202
208
  ) -> Union[AsyncIterable[Any], ExecutionResult]:
203
209
  """Create source event stream
204
210
 
@@ -233,6 +239,7 @@ async def create_source_event_stream(
233
239
  :param subscribe_field_resolver: Resolver used for the root subscription field.
234
240
  :param max_coercion_errors: Set the maximum number of errors allowed for coercing
235
241
  variable values (defaults to 50).
242
+ :param hide_suggestions: Omit suggestions from input coercion errors.
236
243
  :returns: The source event stream, or an execution result containing subscription
237
244
  errors.
238
245
 
@@ -275,6 +282,7 @@ async def create_source_event_stream(
275
282
  operation_name,
276
283
  subscribe_field_resolver=subscribe_field_resolver,
277
284
  max_coercion_errors=max_coercion_errors,
285
+ hide_suggestions=hide_suggestions,
278
286
  )
279
287
 
280
288
  # Return early errors if execution context failed.
@@ -296,6 +304,14 @@ async def create_source_event_stream(
296
304
  # Report it as an ExecutionResult, containing only errors and no data.
297
305
  return ExecutionResult(data=None, errors=[error])
298
306
 
307
+ except RecursionError:
308
+ # This error is never raised, so it has no traceback or context
309
+ # that would keep all the frames of the recursion alive.
310
+ return ExecutionResult(
311
+ data=None,
312
+ errors=[GraphQLError(SELECTIONS_NESTED_TOO_DEEPLY, context.operation)],
313
+ )
314
+
299
315
 
300
316
  async def execute_subscription(context: ExecutionContext) -> AsyncIterable[Any]:
301
317
  """Resolve the event stream of the root subscription field.
@@ -1,6 +1,6 @@
1
1
  """Helpers for handling values"""
2
2
 
3
- from typing import Any, Callable, Collection, Dict, List, Optional, Union, cast
3
+ from typing import Any, Callable, Collection, Dict, List, Optional, Tuple, Union, cast
4
4
 
5
5
  from ..error import GraphQLError
6
6
  from ..language import (
@@ -19,8 +19,9 @@ from ..language import (
19
19
  TypeExtensionNode,
20
20
  VariableDefinitionNode,
21
21
  VariableNode,
22
- print_ast,
23
22
  )
23
+ from ..language.parser import MAX_NESTING_DEPTH
24
+ from ..language.printer import print_for_error
24
25
  from ..pyutils import Undefined, inspect, print_path_list
25
26
  from ..type import (
26
27
  GraphQLDirective,
@@ -29,6 +30,7 @@ from ..type import (
29
30
  GraphQLSchema,
30
31
  is_input_object_type,
31
32
  is_input_type,
33
+ is_list_type,
32
34
  is_non_null_type,
33
35
  )
34
36
  from ..utilities.coerce_input_value import coerce_input_value
@@ -46,12 +48,14 @@ def get_variable_values(
46
48
  var_def_nodes: Collection[VariableDefinitionNode],
47
49
  inputs: Dict[str, Any],
48
50
  max_errors: Optional[int] = None,
51
+ hide_suggestions: bool = False,
49
52
  ) -> CoercedVariableValues:
50
53
  """Get coerced variable values based on provided definitions.
51
54
 
52
55
  Prepares a dict of variable values of the correct type based on the provided
53
56
  variable definitions and arbitrary input. If the input cannot be parsed to match
54
- the variable definitions, a list of GraphQLErrors will be returned instead.
57
+ the variable definitions, a list of GraphQLErrors will be returned instead. This
58
+ also applies to input nested too deeply for the recursion limit of the interpreter.
55
59
 
56
60
  :param schema: GraphQL schema to use.
57
61
  :param var_def_nodes: The variable definition AST nodes to coerce.
@@ -59,6 +63,7 @@ def get_variable_values(
59
63
  :param max_errors: The maximum number of coercion errors to report (unlimited by
60
64
  default). When the limit is exceeded, an additional error is added and
61
65
  coercion is aborted.
66
+ :param hide_suggestions: Omit suggestions from input coercion errors.
62
67
  :returns: Coerced variable values, or a list of request errors.
63
68
 
64
69
  Coerce provided variables and apply operation defaults:
@@ -118,20 +123,55 @@ def get_variable_values(
118
123
  errors.append(error)
119
124
 
120
125
  try:
121
- coerced = coerce_variable_values(schema, var_def_nodes, inputs, on_error)
126
+ coerced = coerce_variable_values(
127
+ schema, var_def_nodes, inputs, on_error, hide_suggestions
128
+ )
122
129
  if not errors:
123
130
  return coerced
124
131
  except GraphQLError as e:
125
132
  errors.append(e)
133
+ except RecursionError:
134
+ # This error is never raised, so it has no traceback or context
135
+ # that would keep all the frames of the recursion alive.
136
+ errors.append(GraphQLError("Variable values are nested too deeply."))
126
137
 
127
138
  return errors
128
139
 
129
140
 
141
+ def input_is_nested_too_deeply(value: Any, type_: GraphQLInputType) -> bool:
142
+ """Check whether coercing the given value would recurse too deeply.
143
+
144
+ See ``MAX_NESTING_DEPTH`` for why this is needed in addition to handling a stack
145
+ overflow. Only the nesting that the type follows counts, so a deep value of a
146
+ custom scalar is fine.
147
+
148
+ :meta private:
149
+ """
150
+ stack: List[Tuple[Any, Any, int]] = [(value, type_, 0)]
151
+ while stack:
152
+ current, current_type, depth = stack.pop()
153
+ if depth > MAX_NESTING_DEPTH:
154
+ return True
155
+ if is_non_null_type(current_type):
156
+ current_type = current_type.of_type
157
+ if is_list_type(current_type):
158
+ items = current if isinstance(current, (list, tuple)) else [current]
159
+ stack.extend((item, current_type.of_type, depth + 1) for item in items)
160
+ elif is_input_object_type(current_type) and isinstance(current, dict):
161
+ stack.extend(
162
+ (current[name], field.type, depth + 1)
163
+ for name, field in current_type.fields.items()
164
+ if name in current
165
+ )
166
+ return False
167
+
168
+
130
169
  def coerce_variable_values(
131
170
  schema: GraphQLSchema,
132
171
  var_def_nodes: Collection[VariableDefinitionNode],
133
172
  inputs: Dict[str, Any],
134
173
  on_error: Callable[[GraphQLError], None],
174
+ hide_suggestions: bool = False,
135
175
  ) -> Dict[str, Any]:
136
176
  """Coerce the variable values, reporting errors via the given callback.
137
177
 
@@ -144,7 +184,7 @@ def coerce_variable_values(
144
184
  if not is_input_type(var_type):
145
185
  # Must use input types for variables. This should be caught during
146
186
  # validation, however is checked again here for safety.
147
- var_type_str = print_ast(var_def_node.type)
187
+ var_type_str = print_for_error(var_def_node.type)
148
188
  on_error(
149
189
  GraphQLError(
150
190
  f"Variable '${var_name}' expected value of type '{var_type_str}'"
@@ -202,8 +242,10 @@ def coerce_variable_values(
202
242
  )
203
243
  )
204
244
 
245
+ if input_is_nested_too_deeply(value, var_type):
246
+ raise RecursionError
205
247
  coerced_values[var_name] = coerce_input_value(
206
- value, var_type, on_input_value_error
248
+ value, var_type, on_input_value_error, None, hide_suggestions
207
249
  )
208
250
 
209
251
  return coerced_values
@@ -316,7 +358,7 @@ def get_argument_values(
316
358
  # execution. This is a runtime check to ensure execution does not
317
359
  # continue with an invalid argument value.
318
360
  raise GraphQLError(
319
- f"Argument '{name}' has invalid value {print_ast(value_node)}.",
361
+ f"Argument '{name}' has invalid value {print_for_error(value_node)}.",
320
362
  value_node,
321
363
  )
322
364
  coerced_values[arg_def.out_name or name] = coerced_value
@@ -29,6 +29,7 @@ async def graphql(
29
29
  middleware: Optional[Middleware] = None,
30
30
  execution_context_class: Optional[Type[ExecutionContext]] = None,
31
31
  is_awaitable: Optional[Callable[[Any], bool]] = None,
32
+ hide_suggestions: bool = False,
32
33
  ) -> ExecutionResult:
33
34
  """Execute a GraphQL operation asynchronously.
34
35
 
@@ -68,6 +69,8 @@ async def graphql(
68
69
  context.
69
70
  :param is_awaitable: The predicate to be used for checking whether values are
70
71
  awaitable.
72
+ :param hide_suggestions: Omit suggestions from validation and input coercion
73
+ errors.
71
74
  :returns: The execution result, or the request errors if parsing or validation
72
75
  fails.
73
76
 
@@ -135,6 +138,7 @@ async def graphql(
135
138
  middleware,
136
139
  execution_context_class,
137
140
  is_awaitable,
141
+ hide_suggestions,
138
142
  )
139
143
 
140
144
  if isawaitable(result):
@@ -163,6 +167,7 @@ def graphql_sync(
163
167
  middleware: Optional[Middleware] = None,
164
168
  execution_context_class: Optional[Type[ExecutionContext]] = None,
165
169
  check_sync: bool = False,
170
+ hide_suggestions: bool = False,
166
171
  ) -> ExecutionResult:
167
172
  """Execute a GraphQL operation synchronously.
168
173
 
@@ -194,6 +199,8 @@ def graphql_sync(
194
199
  context.
195
200
  :param check_sync: Set this to ``True`` to still run checks that no awaitable
196
201
  values are returned. By default, everything is assumed to be synchronous.
202
+ :param hide_suggestions: Omit suggestions from validation and input coercion
203
+ errors.
197
204
  :returns: The completed execution result, or the request errors if parsing or
198
205
  validation fails.
199
206
 
@@ -246,6 +253,7 @@ def graphql_sync(
246
253
  middleware,
247
254
  execution_context_class,
248
255
  is_awaitable,
256
+ hide_suggestions,
249
257
  )
250
258
 
251
259
  # Assert that the execution was synchronous.
@@ -270,6 +278,7 @@ def graphql_impl(
270
278
  middleware: Optional[Middleware],
271
279
  execution_context_class: Optional[Type[ExecutionContext]],
272
280
  is_awaitable: Optional[Callable[[Any], bool]],
281
+ hide_suggestions: bool,
273
282
  ) -> AwaitableOrValue[ExecutionResult]:
274
283
  """Execute a query, return asynchronously only if necessary.
275
284
 
@@ -289,7 +298,7 @@ def graphql_impl(
289
298
  # Validate
290
299
  from .validation import validate
291
300
 
292
- validation_errors = validate(schema, document)
301
+ validation_errors = validate(schema, document, hide_suggestions=hide_suggestions)
293
302
  if validation_errors:
294
303
  return ExecutionResult(data=None, errors=validation_errors)
295
304
 
@@ -308,4 +317,5 @@ def graphql_impl(
308
317
  middleware,
309
318
  execution_context_class,
310
319
  is_awaitable,
320
+ hide_suggestions,
311
321
  )
@@ -541,7 +541,10 @@ class DocumentNode(Node):
541
541
  # that it is not treated as a traversable attribute, the equivalent of the
542
542
  # non-enumerable ``tokenCount`` property in graphql-js.
543
543
  token_count: int = 0
544
- """The number of lexical tokens parsed for this document."""
544
+ """The number of tokens parsed for this document.
545
+
546
+ The count includes comments, unlike in GraphQL.js.
547
+ """
545
548
 
546
549
 
547
550
  class DefinitionNode(Node):