graphql 2.6.15 → 2.6.16
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.
- checksums.yaml +4 -4
- data/lib/generators/graphql/core.rb +1 -0
- data/lib/generators/graphql/detailed_trace_generator.rb +1 -0
- data/lib/generators/graphql/enum_generator.rb +1 -0
- data/lib/generators/graphql/field_extractor.rb +1 -0
- data/lib/generators/graphql/input_generator.rb +1 -0
- data/lib/generators/graphql/install/mutation_root_generator.rb +1 -0
- data/lib/generators/graphql/install_generator.rb +1 -0
- data/lib/generators/graphql/interface_generator.rb +1 -0
- data/lib/generators/graphql/loader_generator.rb +1 -0
- data/lib/generators/graphql/mutation_create_generator.rb +1 -0
- data/lib/generators/graphql/mutation_delete_generator.rb +1 -0
- data/lib/generators/graphql/mutation_generator.rb +1 -0
- data/lib/generators/graphql/mutation_update_generator.rb +1 -0
- data/lib/generators/graphql/object_generator.rb +1 -0
- data/lib/generators/graphql/orm_mutations_base.rb +1 -0
- data/lib/generators/graphql/relay.rb +1 -0
- data/lib/generators/graphql/relay_generator.rb +1 -0
- data/lib/generators/graphql/scalar_generator.rb +1 -0
- data/lib/generators/graphql/type_generator.rb +1 -0
- data/lib/generators/graphql/union_generator.rb +1 -0
- data/lib/graphql/analysis/analyzer.rb +1 -0
- data/lib/graphql/analysis/field_usage.rb +1 -0
- data/lib/graphql/analysis/max_query_complexity.rb +1 -0
- data/lib/graphql/analysis/max_query_depth.rb +1 -0
- data/lib/graphql/analysis/query_complexity.rb +5 -1
- data/lib/graphql/analysis/query_depth.rb +1 -0
- data/lib/graphql/analysis/visitor.rb +1 -0
- data/lib/graphql/analysis.rb +1 -0
- data/lib/graphql/analysis_error.rb +1 -0
- data/lib/graphql/autoload.rb +1 -0
- data/lib/graphql/backtrace/table.rb +1 -0
- data/lib/graphql/backtrace/traced_error.rb +1 -0
- data/lib/graphql/backtrace.rb +1 -0
- data/lib/graphql/coercion_error.rb +1 -0
- data/lib/graphql/current.rb +1 -0
- data/lib/graphql/dashboard/application_controller.rb +1 -0
- data/lib/graphql/dashboard/detailed_traces.rb +1 -0
- data/lib/graphql/dashboard/installable.rb +1 -0
- data/lib/graphql/dashboard/landings_controller.rb +1 -0
- data/lib/graphql/dashboard/limiters.rb +1 -0
- data/lib/graphql/dashboard/operation_store.rb +1 -0
- data/lib/graphql/dashboard/statics_controller.rb +1 -0
- data/lib/graphql/dashboard/subscriptions.rb +1 -0
- data/lib/graphql/dashboard.rb +1 -0
- data/lib/graphql/dataloader/active_record_association_source.rb +1 -0
- data/lib/graphql/dataloader/active_record_source.rb +1 -0
- data/lib/graphql/dataloader/async_dataloader.rb +1 -0
- data/lib/graphql/dataloader/null_dataloader.rb +1 -0
- data/lib/graphql/dataloader/request.rb +1 -0
- data/lib/graphql/dataloader/request_all.rb +1 -0
- data/lib/graphql/dataloader/source.rb +1 -0
- data/lib/graphql/dataloader.rb +1 -0
- data/lib/graphql/date_encoding_error.rb +1 -0
- data/lib/graphql/dig.rb +1 -0
- data/lib/graphql/duration_encoding_error.rb +1 -0
- data/lib/graphql/execution/directive_checks.rb +1 -0
- data/lib/graphql/execution/errors.rb +1 -0
- data/lib/graphql/execution/field_resolve_step.rb +1 -0
- data/lib/graphql/execution/finalize.rb +1 -0
- data/lib/graphql/execution/input_values.rb +42 -6
- data/lib/graphql/execution/interpreter/argument_value.rb +1 -0
- data/lib/graphql/execution/interpreter/arguments.rb +1 -0
- data/lib/graphql/execution/interpreter/arguments_cache.rb +1 -0
- data/lib/graphql/execution/interpreter/execution_errors.rb +7 -4
- data/lib/graphql/execution/interpreter/handles_raw_value.rb +6 -2
- data/lib/graphql/execution/interpreter/resolve.rb +6 -2
- data/lib/graphql/execution/interpreter/runtime/graphql_result.rb +1 -0
- data/lib/graphql/execution/interpreter/runtime.rb +5 -3
- data/lib/graphql/execution/interpreter.rb +7 -4
- data/lib/graphql/execution/lazy/lazy_method_map.rb +1 -0
- data/lib/graphql/execution/lazy.rb +1 -0
- data/lib/graphql/execution/load_argument_step.rb +1 -0
- data/lib/graphql/execution/lookahead.rb +2 -0
- data/lib/graphql/execution/multiplex.rb +1 -0
- data/lib/graphql/execution/next.rb +1 -0
- data/lib/graphql/execution/prepare_object_step.rb +3 -5
- data/lib/graphql/execution/resolve_type_step.rb +1 -0
- data/lib/graphql/execution/runner.rb +2 -0
- data/lib/graphql/execution/selections_step.rb +1 -0
- data/lib/graphql/execution/variable_values.rb +20 -6
- data/lib/graphql/execution.rb +1 -0
- data/lib/graphql/execution_error.rb +1 -0
- data/lib/graphql/float_decoding_error.rb +1 -0
- data/lib/graphql/float_encoding_error.rb +1 -0
- data/lib/graphql/integer_decoding_error.rb +1 -0
- data/lib/graphql/integer_encoding_error.rb +1 -0
- data/lib/graphql/introspection/base_object.rb +1 -0
- data/lib/graphql/introspection/directive_location_enum.rb +1 -0
- data/lib/graphql/introspection/directive_type.rb +1 -0
- data/lib/graphql/introspection/dynamic_fields.rb +1 -0
- data/lib/graphql/introspection/entry_points.rb +1 -0
- data/lib/graphql/introspection/enum_value_type.rb +1 -0
- data/lib/graphql/introspection/field_type.rb +1 -0
- data/lib/graphql/introspection/input_value_type.rb +1 -0
- data/lib/graphql/introspection/introspection_query.rb +10 -7
- data/lib/graphql/introspection/schema_type.rb +1 -0
- data/lib/graphql/introspection/type_kind_enum.rb +1 -0
- data/lib/graphql/introspection/type_type.rb +1 -0
- data/lib/graphql/introspection.rb +1 -0
- data/lib/graphql/invalid_name_error.rb +1 -0
- data/lib/graphql/invalid_null_error.rb +1 -0
- data/lib/graphql/language/block_string.rb +12 -5
- data/lib/graphql/language/cache.rb +1 -0
- data/lib/graphql/language/comment.rb +1 -0
- data/lib/graphql/language/definition_slice.rb +1 -0
- data/lib/graphql/language/document_from_schema_definition.rb +1 -0
- data/lib/graphql/language/generation.rb +1 -0
- data/lib/graphql/language/lexer.rb +4 -4
- data/lib/graphql/language/nodes.rb +1 -0
- data/lib/graphql/language/parser.rb +1 -0
- data/lib/graphql/language/printer.rb +1 -0
- data/lib/graphql/language/sanitized_printer.rb +1 -0
- data/lib/graphql/language/static_visitor.rb +1 -0
- data/lib/graphql/language/visitor.rb +1 -0
- data/lib/graphql/language.rb +1 -0
- data/lib/graphql/load_application_object_failed_error.rb +1 -0
- data/lib/graphql/name_validator.rb +1 -0
- data/lib/graphql/pagination/active_record_relation_connection.rb +9 -1
- data/lib/graphql/pagination/array_connection.rb +1 -0
- data/lib/graphql/pagination/connection.rb +1 -0
- data/lib/graphql/pagination/connections.rb +1 -0
- data/lib/graphql/pagination/mongoid_relation_connection.rb +6 -1
- data/lib/graphql/pagination/relation_connection.rb +5 -4
- data/lib/graphql/pagination/sequel_dataset_connection.rb +6 -1
- data/lib/graphql/pagination.rb +1 -0
- data/lib/graphql/parse_error.rb +1 -0
- data/lib/graphql/query/context/scoped_context.rb +1 -0
- data/lib/graphql/query/context.rb +1 -0
- data/lib/graphql/query/fingerprint.rb +1 -0
- data/lib/graphql/query/input_validation_result.rb +44 -0
- data/lib/graphql/query/null_context.rb +1 -0
- data/lib/graphql/query/partial.rb +1 -0
- data/lib/graphql/query/result.rb +1 -0
- data/lib/graphql/query/validation_pipeline.rb +1 -0
- data/lib/graphql/query/variable_validation_error.rb +1 -0
- data/lib/graphql/query.rb +1 -0
- data/lib/graphql/railtie.rb +1 -0
- data/lib/graphql/rake_task/validate.rb +1 -0
- data/lib/graphql/rake_task.rb +1 -0
- data/lib/graphql/relay/range_add.rb +1 -0
- data/lib/graphql/relay.rb +1 -0
- data/lib/graphql/rubocop/graphql/base_cop.rb +1 -0
- data/lib/graphql/rubocop/graphql/default_null_true.rb +1 -0
- data/lib/graphql/rubocop/graphql/default_required_true.rb +1 -0
- data/lib/graphql/rubocop/graphql/field_type_in_block.rb +1 -0
- data/lib/graphql/rubocop/graphql/root_types_in_block.rb +1 -0
- data/lib/graphql/rubocop.rb +1 -0
- data/lib/graphql/runtime_error.rb +1 -0
- data/lib/graphql/runtime_type_error.rb +1 -0
- data/lib/graphql/schema/addition.rb +1 -0
- data/lib/graphql/schema/always_visible.rb +1 -0
- data/lib/graphql/schema/argument.rb +1 -0
- data/lib/graphql/schema/base_64_encoder.rb +1 -0
- data/lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb +6 -3
- data/lib/graphql/schema/build_from_definition/resolve_map.rb +1 -0
- data/lib/graphql/schema/build_from_definition.rb +1 -0
- data/lib/graphql/schema/built_in_types.rb +1 -0
- data/lib/graphql/schema/directive/deprecated.rb +1 -0
- data/lib/graphql/schema/directive/feature.rb +1 -0
- data/lib/graphql/schema/directive/flagged.rb +5 -1
- data/lib/graphql/schema/directive/include.rb +1 -0
- data/lib/graphql/schema/directive/one_of.rb +5 -2
- data/lib/graphql/schema/directive/skip.rb +1 -0
- data/lib/graphql/schema/directive/specified_by.rb +1 -0
- data/lib/graphql/schema/directive/transform.rb +9 -4
- data/lib/graphql/schema/directive.rb +1 -0
- data/lib/graphql/schema/enum.rb +1 -0
- data/lib/graphql/schema/enum_value.rb +1 -0
- data/lib/graphql/schema/field/connection_extension.rb +6 -2
- data/lib/graphql/schema/field/scope_extension.rb +1 -0
- data/lib/graphql/schema/field.rb +1 -0
- data/lib/graphql/schema/field_extension.rb +1 -0
- data/lib/graphql/schema/find_inherited_value.rb +1 -0
- data/lib/graphql/schema/finder.rb +1 -0
- data/lib/graphql/schema/has_single_input_argument.rb +1 -0
- data/lib/graphql/schema/input_object.rb +1 -0
- data/lib/graphql/schema/interface.rb +1 -0
- data/lib/graphql/schema/introspection_system.rb +1 -0
- data/lib/graphql/schema/late_bound_type.rb +1 -0
- data/lib/graphql/schema/list.rb +1 -0
- data/lib/graphql/schema/loader.rb +1 -0
- data/lib/graphql/schema/member/base_dsl_methods.rb +1 -0
- data/lib/graphql/schema/member/build_type.rb +1 -0
- data/lib/graphql/schema/member/graphql_type_names.rb +1 -0
- data/lib/graphql/schema/member/has_arguments.rb +1 -0
- data/lib/graphql/schema/member/has_ast_node.rb +7 -2
- data/lib/graphql/schema/member/has_authorization.rb +7 -4
- data/lib/graphql/schema/member/has_dataloader.rb +1 -0
- data/lib/graphql/schema/member/has_deprecation_reason.rb +7 -2
- data/lib/graphql/schema/member/has_directives.rb +1 -0
- data/lib/graphql/schema/member/has_fields.rb +1 -0
- data/lib/graphql/schema/member/has_interfaces.rb +1 -0
- data/lib/graphql/schema/member/has_path.rb +1 -0
- data/lib/graphql/schema/member/has_unresolved_type_error.rb +1 -0
- data/lib/graphql/schema/member/has_validators.rb +1 -0
- data/lib/graphql/schema/member/relay_shortcuts.rb +1 -0
- data/lib/graphql/schema/member/scoped.rb +7 -3
- data/lib/graphql/schema/member/type_system_helpers.rb +1 -0
- data/lib/graphql/schema/member/validates_input.rb +7 -1
- data/lib/graphql/schema/member.rb +1 -0
- data/lib/graphql/schema/mutation.rb +1 -0
- data/lib/graphql/schema/non_null.rb +1 -0
- data/lib/graphql/schema/object.rb +1 -0
- data/lib/graphql/schema/printer.rb +1 -0
- data/lib/graphql/schema/ractor_shareable.rb +1 -0
- data/lib/graphql/schema/relay_classic_mutation.rb +8 -3
- data/lib/graphql/schema/resolver/has_payload_type.rb +1 -0
- data/lib/graphql/schema/resolver.rb +3 -1
- data/lib/graphql/schema/scalar.rb +27 -3
- data/lib/graphql/schema/subscription.rb +1 -0
- data/lib/graphql/schema/timeout.rb +1 -0
- data/lib/graphql/schema/type_expression.rb +1 -0
- data/lib/graphql/schema/type_membership.rb +1 -0
- data/lib/graphql/schema/union.rb +1 -0
- data/lib/graphql/schema/unique_within_type.rb +1 -0
- data/lib/graphql/schema/validator/all_validator.rb +1 -0
- data/lib/graphql/schema/validator/allow_blank_validator.rb +5 -2
- data/lib/graphql/schema/validator/allow_null_validator.rb +6 -3
- data/lib/graphql/schema/validator/exclusion_validator.rb +7 -4
- data/lib/graphql/schema/validator/format_validator.rb +7 -4
- data/lib/graphql/schema/validator/inclusion_validator.rb +6 -3
- data/lib/graphql/schema/validator/length_validator.rb +1 -0
- data/lib/graphql/schema/validator/numericality_validator.rb +1 -0
- data/lib/graphql/schema/validator/required_validator.rb +1 -0
- data/lib/graphql/schema/validator.rb +3 -2
- data/lib/graphql/schema/visibility/migration.rb +1 -0
- data/lib/graphql/schema/visibility/profile.rb +1 -0
- data/lib/graphql/schema/visibility/visit.rb +1 -0
- data/lib/graphql/schema/visibility.rb +1 -0
- data/lib/graphql/schema/warden.rb +1 -0
- data/lib/graphql/schema/wrapper.rb +1 -0
- data/lib/graphql/schema.rb +1 -0
- data/lib/graphql/static_validation/all_rules.rb +1 -0
- data/lib/graphql/static_validation/base_visitor.rb +1 -0
- data/lib/graphql/static_validation/definition_dependencies.rb +1 -0
- data/lib/graphql/static_validation/error.rb +14 -5
- data/lib/graphql/static_validation/interpreter_visitor.rb +1 -0
- data/lib/graphql/static_validation/rules/argument_literals_are_compatible.rb +9 -3
- data/lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb +16 -8
- data/lib/graphql/static_validation/rules/argument_names_are_unique.rb +1 -0
- data/lib/graphql/static_validation/rules/argument_names_are_unique_error.rb +8 -3
- data/lib/graphql/static_validation/rules/arguments_are_defined.rb +10 -4
- data/lib/graphql/static_validation/rules/arguments_are_defined_error.rb +14 -6
- data/lib/graphql/static_validation/rules/directives_are_defined.rb +7 -9
- data/lib/graphql/static_validation/rules/directives_are_defined_error.rb +8 -3
- data/lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb +12 -7
- data/lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb +10 -4
- data/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb +1 -0
- data/lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb +10 -4
- data/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb +1 -0
- data/lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb +10 -4
- data/lib/graphql/static_validation/rules/fields_will_merge.rb +2 -3
- data/lib/graphql/static_validation/rules/fields_will_merge_error.rb +15 -4
- data/lib/graphql/static_validation/rules/fragment_names_are_unique.rb +10 -5
- data/lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb +8 -3
- data/lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb +30 -14
- data/lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb +12 -5
- data/lib/graphql/static_validation/rules/fragment_types_exist.rb +11 -6
- data/lib/graphql/static_validation/rules/fragment_types_exist_error.rb +8 -3
- data/lib/graphql/static_validation/rules/fragments_are_finite.rb +1 -0
- data/lib/graphql/static_validation/rules/fragments_are_finite_error.rb +8 -3
- data/lib/graphql/static_validation/rules/fragments_are_named.rb +1 -0
- data/lib/graphql/static_validation/rules/fragments_are_named_error.rb +1 -0
- data/lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb +1 -0
- data/lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb +8 -4
- data/lib/graphql/static_validation/rules/fragments_are_used.rb +1 -0
- data/lib/graphql/static_validation/rules/fragments_are_used_error.rb +8 -3
- data/lib/graphql/static_validation/rules/input_object_names_are_unique.rb +1 -0
- data/lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb +8 -3
- data/lib/graphql/static_validation/rules/mutation_root_exists.rb +1 -0
- data/lib/graphql/static_validation/rules/mutation_root_exists_error.rb +1 -0
- data/lib/graphql/static_validation/rules/no_definitions_are_present.rb +7 -3
- data/lib/graphql/static_validation/rules/no_definitions_are_present_error.rb +1 -0
- data/lib/graphql/static_validation/rules/not_single_subscription_error.rb +1 -0
- data/lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb +10 -4
- data/lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb +7 -2
- data/lib/graphql/static_validation/rules/operation_names_are_valid.rb +10 -4
- data/lib/graphql/static_validation/rules/operation_names_are_valid_error.rb +7 -2
- data/lib/graphql/static_validation/rules/query_root_exists.rb +1 -0
- data/lib/graphql/static_validation/rules/query_root_exists_error.rb +1 -0
- data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +19 -10
- data/lib/graphql/static_validation/rules/required_arguments_are_present_error.rb +12 -5
- data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb +5 -1
- data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb +1 -0
- data/lib/graphql/static_validation/rules/subscription_root_exists_and_single_subscription_selection.rb +1 -0
- data/lib/graphql/static_validation/rules/subscription_root_exists_error.rb +1 -0
- data/lib/graphql/static_validation/rules/unique_directives_per_location.rb +2 -1
- data/lib/graphql/static_validation/rules/unique_directives_per_location_error.rb +8 -3
- data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb +1 -0
- data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb +13 -6
- data/lib/graphql/static_validation/rules/variable_names_are_unique.rb +1 -0
- data/lib/graphql/static_validation/rules/variable_names_are_unique_error.rb +8 -3
- data/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb +16 -8
- data/lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb +14 -6
- data/lib/graphql/static_validation/rules/variables_are_input_types.rb +8 -5
- data/lib/graphql/static_validation/rules/variables_are_input_types_error.rb +10 -4
- data/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb +1 -0
- data/lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb +11 -5
- data/lib/graphql/static_validation/validation_context.rb +4 -1
- data/lib/graphql/static_validation/validation_timeout_error.rb +1 -0
- data/lib/graphql/static_validation/validator.rb +7 -3
- data/lib/graphql/static_validation.rb +1 -0
- data/lib/graphql/string_encoding_error.rb +1 -0
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +1 -0
- data/lib/graphql/subscriptions/broadcast_analyzer.rb +1 -0
- data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +1 -0
- data/lib/graphql/subscriptions/event.rb +1 -0
- data/lib/graphql/subscriptions/serialize.rb +1 -0
- data/lib/graphql/subscriptions.rb +1 -0
- data/lib/graphql/testing/helpers.rb +1 -0
- data/lib/graphql/testing/mock_action_cable.rb +1 -0
- data/lib/graphql/testing.rb +1 -0
- data/lib/graphql/tracing/active_support_notifications_trace.rb +1 -0
- data/lib/graphql/tracing/active_support_notifications_tracing.rb +1 -0
- data/lib/graphql/tracing/appoptics_trace.rb +1 -0
- data/lib/graphql/tracing/appoptics_tracing.rb +1 -0
- data/lib/graphql/tracing/appsignal_trace.rb +1 -0
- data/lib/graphql/tracing/appsignal_tracing.rb +1 -0
- data/lib/graphql/tracing/call_legacy_tracers.rb +1 -0
- data/lib/graphql/tracing/data_dog_trace.rb +1 -0
- data/lib/graphql/tracing/data_dog_tracing.rb +1 -0
- data/lib/graphql/tracing/detailed_trace/active_record_backend.rb +1 -0
- data/lib/graphql/tracing/detailed_trace/memory_backend.rb +1 -0
- data/lib/graphql/tracing/detailed_trace/redis_backend.rb +1 -0
- data/lib/graphql/tracing/detailed_trace.rb +1 -0
- data/lib/graphql/tracing/legacy_hooks_trace.rb +1 -0
- data/lib/graphql/tracing/legacy_trace.rb +1 -0
- data/lib/graphql/tracing/monitor_trace.rb +1 -0
- data/lib/graphql/tracing/new_relic_trace.rb +1 -0
- data/lib/graphql/tracing/new_relic_tracing.rb +1 -0
- data/lib/graphql/tracing/notifications_trace.rb +1 -0
- data/lib/graphql/tracing/notifications_tracing.rb +1 -0
- data/lib/graphql/tracing/null_trace.rb +1 -0
- data/lib/graphql/tracing/perfetto_trace/trace_pb.rb +1 -0
- data/lib/graphql/tracing/perfetto_trace.rb +1 -0
- data/lib/graphql/tracing/platform_trace.rb +1 -0
- data/lib/graphql/tracing/platform_tracing.rb +1 -0
- data/lib/graphql/tracing/prometheus_trace/graphql_collector.rb +1 -0
- data/lib/graphql/tracing/prometheus_trace.rb +1 -0
- data/lib/graphql/tracing/prometheus_tracing.rb +1 -0
- data/lib/graphql/tracing/scout_trace.rb +1 -0
- data/lib/graphql/tracing/scout_tracing.rb +1 -0
- data/lib/graphql/tracing/sentry_trace.rb +1 -0
- data/lib/graphql/tracing/statsd_trace.rb +1 -0
- data/lib/graphql/tracing/statsd_tracing.rb +1 -0
- data/lib/graphql/tracing/trace.rb +1 -0
- data/lib/graphql/tracing.rb +1 -0
- data/lib/graphql/type_kinds.rb +1 -0
- data/lib/graphql/types/big_int.rb +1 -0
- data/lib/graphql/types/boolean.rb +1 -0
- data/lib/graphql/types/float.rb +4 -1
- data/lib/graphql/types/id.rb +1 -0
- data/lib/graphql/types/int.rb +6 -3
- data/lib/graphql/types/iso_8601_date.rb +3 -1
- data/lib/graphql/types/iso_8601_date_time.rb +1 -0
- data/lib/graphql/types/iso_8601_duration.rb +4 -2
- data/lib/graphql/types/json.rb +4 -1
- data/lib/graphql/types/relay/base_connection.rb +1 -0
- data/lib/graphql/types/relay/base_edge.rb +1 -0
- data/lib/graphql/types/relay/connection_behaviors.rb +1 -2
- data/lib/graphql/types/relay/edge_behaviors.rb +1 -2
- data/lib/graphql/types/relay/has_node_field.rb +7 -1
- data/lib/graphql/types/relay/has_nodes_field.rb +7 -1
- data/lib/graphql/types/relay/node.rb +1 -0
- data/lib/graphql/types/relay/node_behaviors.rb +7 -1
- data/lib/graphql/types/relay/page_info.rb +1 -0
- data/lib/graphql/types/relay/page_info_behaviors.rb +1 -0
- data/lib/graphql/types/relay.rb +1 -0
- data/lib/graphql/types/string.rb +3 -1
- data/lib/graphql/types.rb +1 -0
- data/lib/graphql/unauthorized_enum_value_error.rb +1 -0
- data/lib/graphql/unauthorized_error.rb +1 -0
- data/lib/graphql/unauthorized_field_error.rb +1 -0
- data/lib/graphql/unresolved_type_error.rb +1 -0
- data/lib/graphql/version.rb +2 -1
- data/lib/graphql.rb +1 -0
- metadata +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
#--
|
|
2
3
|
# typed: true
|
|
3
4
|
require "graphql/execution/interpreter/runtime/graphql_result"
|
|
4
5
|
|
|
@@ -220,8 +221,9 @@ module GraphQL
|
|
|
220
221
|
end
|
|
221
222
|
end
|
|
222
223
|
|
|
223
|
-
#: (untyped, untyped, untyped, untyped, Array[untyped]?, untyped, untyped) -> untyped
|
|
224
|
+
#: (untyped, untyped, untyped, untyped, Array[untyped]?, untyped, untyped, ?inlined_fragments: Hash[untyped, Hash[String, bool]]?) -> untyped
|
|
224
225
|
def gather_selections(graphql_response, owner_object, owner_type, selections, selections_to_run, selections_by_name, ordered_result_keys, inlined_fragments: nil)
|
|
226
|
+
inlined_fragments = inlined_fragments #: Hash[untyped, Hash[String, bool]]?
|
|
225
227
|
selections.each do |node|
|
|
226
228
|
if node.is_a?(GraphQL::Language::Nodes::Field)
|
|
227
229
|
response_key = node.alias || node.name
|
|
@@ -508,14 +510,14 @@ module GraphQL
|
|
|
508
510
|
end
|
|
509
511
|
@current_trace.end_execute_field(field_defn, object, kwarg_arguments, query, app_result)
|
|
510
512
|
after_lazy(app_result, field: field_defn, ast_node: ast_node, owner_object: object, arguments: resolved_arguments, result_name: result_name, result: selection_result, runtime_state: runtime_state) do |inner_result, runtime_state|
|
|
513
|
+
was_scoped = runtime_state.was_authorized_by_scope_items
|
|
514
|
+
runtime_state.was_authorized_by_scope_items = nil
|
|
511
515
|
next if selection_result.collect_result(result_name, inner_result)
|
|
512
516
|
|
|
513
517
|
owner_type = selection_result.graphql_result_type
|
|
514
518
|
return_type = field_defn.type
|
|
515
519
|
continue_value = continue_value(inner_result, field_defn, return_type.non_null?, ast_node, result_name, selection_result)
|
|
516
520
|
if HALT != continue_value
|
|
517
|
-
was_scoped = runtime_state.was_authorized_by_scope_items
|
|
518
|
-
runtime_state.was_authorized_by_scope_items = nil
|
|
519
521
|
continue_field(continue_value, owner_type, field_defn, return_type, ast_node, next_selections, false, object, resolved_arguments, result_name, selection_result, was_scoped, runtime_state)
|
|
520
522
|
else
|
|
521
523
|
nil
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
require "fiber"
|
|
4
5
|
require "graphql/execution/interpreter/argument_value"
|
|
5
6
|
require "graphql/execution/interpreter/arguments"
|
|
@@ -30,6 +31,7 @@ module GraphQL
|
|
|
30
31
|
#
|
|
31
32
|
# :call-seq:
|
|
32
33
|
# run_all(GraphQL::Schema schema, query_options, Hash context:, Integer | nil max_complexity:) -> Array[GraphQL::Query::Result]
|
|
34
|
+
#: (singleton(GraphQL::Schema) schema, Array[untyped] query_options, ?context: Hash[Symbol, untyped], ?max_complexity: Integer?) -> Array[GraphQL::Query::Result]
|
|
33
35
|
def run_all(schema, query_options, context: {}, max_complexity: schema.max_complexity)
|
|
34
36
|
previous_multiplex = Fiber[:__graphql_current_multiplex]
|
|
35
37
|
queries = query_options.map do |opts|
|
|
@@ -42,7 +44,7 @@ module GraphQL
|
|
|
42
44
|
raise "Expected Hash or GraphQL::Query, not #{opts.class} (#{opts.inspect})"
|
|
43
45
|
end
|
|
44
46
|
query
|
|
45
|
-
end
|
|
47
|
+
end #: Array[untyped]
|
|
46
48
|
|
|
47
49
|
return GraphQL::EmptyObjects::EMPTY_ARRAY if queries.empty?
|
|
48
50
|
|
|
@@ -50,8 +52,8 @@ module GraphQL
|
|
|
50
52
|
trace = multiplex.current_trace
|
|
51
53
|
Fiber[:__graphql_current_multiplex] = multiplex
|
|
52
54
|
trace.execute_multiplex(multiplex: multiplex) do
|
|
53
|
-
schema = multiplex.schema
|
|
54
|
-
queries = multiplex.queries
|
|
55
|
+
schema = multiplex.schema #: singleton(GraphQL::Schema)
|
|
56
|
+
queries = multiplex.queries #: Array[untyped]
|
|
55
57
|
multiplex_analyzers = schema.multiplex_analyzers
|
|
56
58
|
if multiplex.max_complexity
|
|
57
59
|
multiplex_analyzers += [GraphQL::Analysis::MaxQueryComplexity]
|
|
@@ -155,6 +157,7 @@ module GraphQL
|
|
|
155
157
|
end
|
|
156
158
|
|
|
157
159
|
class ListResultFailedError < GraphQL::Error
|
|
160
|
+
#: (value: untyped, path: Array[String | Integer], field: GraphQL::Schema::Field) -> void
|
|
158
161
|
def initialize(value:, path:, field:)
|
|
159
162
|
message = "Failed to build a GraphQL list result for field `#{field.path}` at path `#{path.join(".")}`.\n".dup
|
|
160
163
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
#--
|
|
2
3
|
# typed: true
|
|
3
4
|
module GraphQL
|
|
4
5
|
module Execution
|
|
@@ -345,6 +346,7 @@ module GraphQL
|
|
|
345
346
|
end
|
|
346
347
|
|
|
347
348
|
def find_selections(subselections_by_type, selections_on_type, selected_type, ast_selections, arguments, inlined_fragments: nil)
|
|
349
|
+
inlined_fragments = inlined_fragments #: Hash[untyped, Hash[String, bool]]?
|
|
348
350
|
ast_selections.each do |ast_selection|
|
|
349
351
|
next if skipped_by_directive?(ast_selection)
|
|
350
352
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
#--
|
|
2
3
|
# typed: true
|
|
3
4
|
module GraphQL
|
|
4
5
|
module Execution
|
|
@@ -130,11 +131,8 @@ module GraphQL
|
|
|
130
131
|
@graphql_result[@key] = add_field_error(@authorization_error)
|
|
131
132
|
end
|
|
132
133
|
rescue GraphQL::RuntimeError => err
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
else
|
|
136
|
-
@graphql_result[@key] = add_field_error(err)
|
|
137
|
-
end
|
|
134
|
+
# Like the classic runtime, report the raised error itself; add_graphql_error propagates the null for non-null types.
|
|
135
|
+
@graphql_result[@key] = add_field_error(err)
|
|
138
136
|
end
|
|
139
137
|
end
|
|
140
138
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
#--
|
|
2
3
|
# typed: true
|
|
3
4
|
module GraphQL
|
|
4
5
|
module Execution
|
|
@@ -178,6 +179,7 @@ module GraphQL
|
|
|
178
179
|
end
|
|
179
180
|
|
|
180
181
|
def gather_selections(type_defn, ast_selections, selections_step, query, all_selections, prototype_result, into:, inlined_fragments: nil)
|
|
182
|
+
inlined_fragments = inlined_fragments #: Hash[untyped, Hash[String, bool]]?
|
|
181
183
|
ast_selections.each do |ast_selection|
|
|
182
184
|
next if !directives_include?(query, ast_selection)
|
|
183
185
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
#--
|
|
2
3
|
# typed: true
|
|
3
4
|
module GraphQL
|
|
4
5
|
module Execution
|
|
@@ -205,8 +206,8 @@ module GraphQL
|
|
|
205
206
|
end
|
|
206
207
|
|
|
207
208
|
def coerce_scalar_value(value, type, path, result)
|
|
208
|
-
|
|
209
|
-
type.
|
|
209
|
+
scalar_result = begin
|
|
210
|
+
type.validate_non_null_input(value, @context)
|
|
210
211
|
rescue GraphQL::CoercionError => err
|
|
211
212
|
result.add_problem(err.message, path.dup, message: err.message, extensions: err.extensions)
|
|
212
213
|
return nil
|
|
@@ -214,13 +215,26 @@ module GraphQL
|
|
|
214
215
|
result.add_problem(err.message, path.dup)
|
|
215
216
|
return nil
|
|
216
217
|
rescue StandardError => err
|
|
217
|
-
@query.handle_or_reraise(err)
|
|
218
|
+
return @query.handle_or_reraise(err)
|
|
218
219
|
end
|
|
219
220
|
|
|
220
|
-
if
|
|
221
|
-
|
|
221
|
+
if scalar_result && !scalar_result.valid?
|
|
222
|
+
problems = scalar_result.problems
|
|
223
|
+
if problems.nil? || problems.empty?
|
|
224
|
+
result.add_problem("Could not coerce value #{GraphQL::Language.serialize(value)} to #{type.graphql_name}", path.dup)
|
|
225
|
+
else
|
|
226
|
+
problems.each do |problem|
|
|
227
|
+
result.add_problem(problem["explanation"], [*path, *problem["path"]], message: problem["message"], extensions: problem["extensions"])
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
nil
|
|
231
|
+
elsif scalar_result&.coerced_value?
|
|
232
|
+
scalar_result.coerced_value
|
|
233
|
+
else
|
|
234
|
+
# A custom `validate_non_null_input` accepted this value but didn't provide a coerced value.
|
|
235
|
+
# Call `coerce_input` at runtime, like GraphQL-Ruby did before 2.6.15.
|
|
236
|
+
GraphQL::Execution::InputValues::DeferredCoercion.new(type, value)
|
|
222
237
|
end
|
|
223
|
-
coerced_value
|
|
224
238
|
end
|
|
225
239
|
|
|
226
240
|
def add_max_errors_reached_message
|
data/lib/graphql/execution.rb
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
4
|
+
module GraphQL
|
|
5
|
+
module Introspection
|
|
6
|
+
# This query is used by graphql-client so don't add the includeDeprecated
|
|
7
|
+
# argument for inputFields since the server may not support it. Two stage
|
|
8
|
+
# introspection queries will be required to handle this in clients.
|
|
9
|
+
INTROSPECTION_QUERY = GraphQL::Introspection.query #: String
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
module GraphQL
|
|
4
5
|
module Language
|
|
5
6
|
module BlockString
|
|
6
7
|
# Remove leading and trailing whitespace from a block string.
|
|
7
8
|
# See "Block Strings" in https://github.com/facebook/graphql/blob/master/spec/Section%202%20--%20Language.md
|
|
9
|
+
#: (String str) -> String
|
|
8
10
|
def self.trim_whitespace(str)
|
|
9
11
|
# Early return for the most common cases:
|
|
10
12
|
if str == ""
|
|
@@ -43,10 +45,10 @@ module GraphQL
|
|
|
43
45
|
end
|
|
44
46
|
|
|
45
47
|
# Remove leading & trailing blank lines
|
|
46
|
-
while lines.
|
|
48
|
+
while (first_line = lines.first) && contains_only_whitespace?(first_line)
|
|
47
49
|
lines.shift
|
|
48
50
|
end
|
|
49
|
-
while lines.
|
|
51
|
+
while (last_line = lines.last) && contains_only_whitespace?(last_line)
|
|
50
52
|
lines.pop
|
|
51
53
|
end
|
|
52
54
|
|
|
@@ -54,6 +56,7 @@ module GraphQL
|
|
|
54
56
|
lines.size > 1 ? lines.join("\n") : (lines.first || "".dup)
|
|
55
57
|
end
|
|
56
58
|
|
|
59
|
+
#: (String str, ?indent: String) -> String
|
|
57
60
|
def self.print(str, indent: '')
|
|
58
61
|
line_length = 120 - indent.length
|
|
59
62
|
block_str = "".dup
|
|
@@ -87,13 +90,16 @@ module GraphQL
|
|
|
87
90
|
|
|
88
91
|
private
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
#: (String line, Integer length) { (String) -> void } -> void
|
|
94
|
+
def self.break_line(line, length, &block)
|
|
91
95
|
return yield(line) if line.length < length + 5
|
|
92
96
|
|
|
93
97
|
parts = line.split(Regexp.new("((?: |^).{15,#{length - 40}}(?= |$))"))
|
|
94
98
|
return yield(line) if parts.length < 4
|
|
95
99
|
|
|
96
|
-
|
|
100
|
+
# `parts` has at least 4 items:
|
|
101
|
+
first_parts = parts.slice!(0, 3) #: as !nil
|
|
102
|
+
yield(first_parts.join)
|
|
97
103
|
|
|
98
104
|
parts.each_with_index do |part, i|
|
|
99
105
|
next if i % 2 == 1
|
|
@@ -103,6 +109,7 @@ module GraphQL
|
|
|
103
109
|
nil
|
|
104
110
|
end
|
|
105
111
|
|
|
112
|
+
#: (String line) -> bool
|
|
106
113
|
def self.contains_only_whitespace?(line)
|
|
107
114
|
line.match?(/^\s*$/)
|
|
108
115
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
#--
|
|
2
3
|
# typed: true
|
|
3
4
|
module GraphQL
|
|
4
5
|
module Language
|
|
@@ -312,12 +313,11 @@ module GraphQL
|
|
|
312
313
|
ESCAPED_QUOTE = /\\"/;
|
|
313
314
|
STRING_CHAR = /#{ESCAPED_QUOTE}|[^"\\\n\r]|#{UNICODE_ESCAPE}|#{STRING_ESCAPE}/
|
|
314
315
|
QUOTED_STRING_REGEXP = %r{#{QUOTE} (?:#{STRING_CHAR})* #{QUOTE}}x
|
|
316
|
+
# Keep repeated alternatives disjoint to avoid exponential backtracking on older Rubies.
|
|
315
317
|
BLOCK_STRING_REGEXP = %r{
|
|
316
318
|
#{BLOCK_QUOTE}
|
|
317
|
-
(?: [^"
|
|
318
|
-
(
|
|
319
|
-
\\"{0,3}(?!") | # A slash followed by <= 3 quotes that aren't followed by a quote
|
|
320
|
-
\\ | # A slash
|
|
319
|
+
(?: [^"] | # Any character that isn't a quote
|
|
320
|
+
(?<=\\) "{3} (?!") | # Escaped triple quotes
|
|
321
321
|
"{1,2}(?!") # 1 or 2 " followed by something that isn't a quote
|
|
322
322
|
)*
|
|
323
323
|
(?:"")?
|
data/lib/graphql/language.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
require "graphql/pagination/relation_connection"
|
|
4
5
|
|
|
5
6
|
module GraphQL
|
|
@@ -8,6 +9,7 @@ module GraphQL
|
|
|
8
9
|
class ActiveRecordRelationConnection < Pagination::RelationConnection
|
|
9
10
|
private
|
|
10
11
|
|
|
12
|
+
#: (untyped relation) -> Integer
|
|
11
13
|
def relation_count(relation)
|
|
12
14
|
int_or_hash = if already_loaded?(relation)
|
|
13
15
|
relation.size
|
|
@@ -25,6 +27,7 @@ module GraphQL
|
|
|
25
27
|
end
|
|
26
28
|
end
|
|
27
29
|
|
|
30
|
+
#: (untyped relation) -> Integer?
|
|
28
31
|
def relation_limit(relation)
|
|
29
32
|
if relation.is_a?(Array)
|
|
30
33
|
nil
|
|
@@ -33,6 +36,7 @@ module GraphQL
|
|
|
33
36
|
end
|
|
34
37
|
end
|
|
35
38
|
|
|
39
|
+
#: (untyped relation) -> Integer?
|
|
36
40
|
def relation_offset(relation)
|
|
37
41
|
if relation.is_a?(Array)
|
|
38
42
|
nil
|
|
@@ -41,6 +45,7 @@ module GraphQL
|
|
|
41
45
|
end
|
|
42
46
|
end
|
|
43
47
|
|
|
48
|
+
#: (untyped relation) -> untyped
|
|
44
49
|
def null_relation(relation)
|
|
45
50
|
if relation.respond_to?(:none)
|
|
46
51
|
relation.none
|
|
@@ -50,6 +55,7 @@ module GraphQL
|
|
|
50
55
|
end
|
|
51
56
|
end
|
|
52
57
|
|
|
58
|
+
#: (untyped nodes, Integer limit) -> untyped
|
|
53
59
|
def set_limit(nodes, limit)
|
|
54
60
|
if already_loaded?(nodes)
|
|
55
61
|
nodes.take(limit)
|
|
@@ -58,6 +64,7 @@ module GraphQL
|
|
|
58
64
|
end
|
|
59
65
|
end
|
|
60
66
|
|
|
67
|
+
#: (untyped nodes, Integer offset) -> untyped
|
|
61
68
|
def set_offset(nodes, offset)
|
|
62
69
|
if already_loaded?(nodes)
|
|
63
70
|
# If the client sent a bogus cursor beyond the size of the relation,
|
|
@@ -70,6 +77,7 @@ module GraphQL
|
|
|
70
77
|
|
|
71
78
|
private
|
|
72
79
|
|
|
80
|
+
#: (untyped relation) -> bool
|
|
73
81
|
def already_loaded?(relation)
|
|
74
82
|
relation.is_a?(Array) || relation.loaded?
|
|
75
83
|
end
|