graphql 2.6.14 → 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/templates/graphql_controller.erb +7 -1
- 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 +3 -1
- data/lib/graphql/analysis/max_query_depth.rb +3 -1
- data/lib/graphql/analysis/query_complexity.rb +7 -2
- data/lib/graphql/analysis/query_depth.rb +2 -1
- data/lib/graphql/analysis/visitor.rb +15 -2
- data/lib/graphql/analysis.rb +5 -5
- data/lib/graphql/analysis_error.rb +2 -1
- 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 +2 -1
- data/lib/graphql/current.rb +6 -1
- 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 +2 -1
- 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 +4 -1
- data/lib/graphql/dig.rb +1 -0
- data/lib/graphql/duration_encoding_error.rb +4 -1
- data/lib/graphql/execution/directive_checks.rb +3 -1
- data/lib/graphql/execution/errors.rb +19 -7
- data/lib/graphql/execution/field_resolve_step.rb +4 -3
- data/lib/graphql/execution/finalize.rb +1 -0
- data/lib/graphql/execution/input_values.rb +196 -120
- 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 +14 -8
- 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 +21 -8
- data/lib/graphql/execution/multiplex.rb +1 -0
- data/lib/graphql/execution/next.rb +2 -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 +21 -12
- data/lib/graphql/execution/selections_step.rb +2 -1
- data/lib/graphql/execution/variable_values.rb +262 -0
- data/lib/graphql/execution.rb +1 -0
- data/lib/graphql/execution_error.rb +1 -0
- data/lib/graphql/float_decoding_error.rb +4 -1
- data/lib/graphql/float_encoding_error.rb +1 -0
- data/lib/graphql/integer_decoding_error.rb +4 -1
- data/lib/graphql/integer_encoding_error.rb +1 -0
- data/lib/graphql/introspection/base_object.rb +2 -1
- data/lib/graphql/introspection/directive_location_enum.rb +2 -1
- data/lib/graphql/introspection/directive_type.rb +4 -1
- data/lib/graphql/introspection/dynamic_fields.rb +4 -1
- data/lib/graphql/introspection/entry_points.rb +1 -0
- data/lib/graphql/introspection/enum_value_type.rb +4 -1
- data/lib/graphql/introspection/field_type.rb +6 -1
- 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 +2 -1
- data/lib/graphql/introspection/type_type.rb +1 -0
- data/lib/graphql/introspection.rb +3 -1
- 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 +3 -1
- 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 +3 -1
- data/lib/graphql/language/lexer.rb +33 -25
- data/lib/graphql/language/nodes.rb +1 -0
- data/lib/graphql/language/parser.rb +11 -7
- 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 +2 -1
- data/lib/graphql/load_application_object_failed_error.rb +1 -0
- data/lib/graphql/name_validator.rb +3 -1
- 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 +2 -1
- 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 +3 -1
- 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 +5 -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 +9 -12
- data/lib/graphql/railtie.rb +2 -1
- 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 +2 -1
- 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 +2 -1
- data/lib/graphql/runtime_error.rb +2 -1
- data/lib/graphql/runtime_type_error.rb +2 -1
- data/lib/graphql/schema/addition.rb +1 -0
- data/lib/graphql/schema/always_visible.rb +4 -1
- data/lib/graphql/schema/argument.rb +1 -0
- data/lib/graphql/schema/base_64_encoder.rb +4 -1
- 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 +3 -2
- data/lib/graphql/schema/directive/deprecated.rb +2 -1
- 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 +3 -1
- data/lib/graphql/schema/directive/one_of.rb +5 -2
- data/lib/graphql/schema/directive/skip.rb +3 -1
- data/lib/graphql/schema/directive/specified_by.rb +2 -1
- 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 +3 -1
- data/lib/graphql/schema/field.rb +4 -0
- data/lib/graphql/schema/field_extension.rb +1 -0
- data/lib/graphql/schema/find_inherited_value.rb +6 -1
- 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 +2 -1
- 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 +21 -22
- 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 +3 -1
- data/lib/graphql/schema/member/has_unresolved_type_error.rb +3 -1
- 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 +4 -2
- data/lib/graphql/schema/mutation.rb +7 -1
- data/lib/graphql/schema/non_null.rb +1 -0
- data/lib/graphql/schema/object.rb +2 -1
- 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 +5 -3
- 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 +4 -1
- 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 +7 -3
- 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 +2 -1
- data/lib/graphql/static_validation/base_visitor.rb +126 -53
- data/lib/graphql/static_validation/definition_dependencies.rb +15 -2
- data/lib/graphql/static_validation/error.rb +14 -5
- data/lib/graphql/static_validation/interpreter_visitor.rb +2 -1
- 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 +5 -1
- 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 +14 -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 +9 -4
- 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 +3 -1
- data/lib/graphql/static_validation/rules/fragments_are_finite_error.rb +8 -3
- data/lib/graphql/static_validation/rules/fragments_are_named.rb +3 -1
- data/lib/graphql/static_validation/rules/fragments_are_named_error.rb +5 -1
- data/lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb +7 -3
- 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 +3 -1
- 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 +4 -1
- 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 +4 -2
- data/lib/graphql/static_validation/rules/mutation_root_exists_error.rb +5 -1
- 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 +5 -1
- data/lib/graphql/static_validation/rules/not_single_subscription_error.rb +5 -1
- data/lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb +19 -6
- 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 +4 -2
- data/lib/graphql/static_validation/rules/query_root_exists_error.rb +5 -1
- 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 +11 -4
- data/lib/graphql/static_validation/rules/subscription_root_exists_and_single_subscription_selection.rb +9 -6
- data/lib/graphql/static_validation/rules/subscription_root_exists_error.rb +5 -1
- data/lib/graphql/static_validation/rules/unique_directives_per_location.rb +7 -5
- 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 +3 -1
- 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 +3 -1
- 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 +17 -9
- 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 +9 -6
- 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 +52 -14
- data/lib/graphql/static_validation/validation_timeout_error.rb +5 -1
- data/lib/graphql/static_validation/validator.rb +7 -3
- data/lib/graphql/static_validation.rb +2 -2
- data/lib/graphql/string_encoding_error.rb +1 -0
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +15 -13
- 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 +2 -1
- 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 +2 -1
- 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 +2 -1
- 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 +5 -1
- data/lib/graphql/types/boolean.rb +4 -1
- data/lib/graphql/types/float.rb +4 -1
- data/lib/graphql/types/id.rb +4 -1
- data/lib/graphql/types/int.rb +6 -3
- data/lib/graphql/types/iso_8601_date.rb +4 -1
- data/lib/graphql/types/iso_8601_date_time.rb +7 -2
- data/lib/graphql/types/iso_8601_duration.rb +7 -2
- data/lib/graphql/types/json.rb +4 -1
- data/lib/graphql/types/relay/base_connection.rb +2 -1
- data/lib/graphql/types/relay/base_edge.rb +2 -1
- 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 +2 -1
- data/lib/graphql/types/relay/node_behaviors.rb +7 -1
- data/lib/graphql/types/relay/page_info.rb +2 -1
- data/lib/graphql/types/relay/page_info_behaviors.rb +5 -1
- data/lib/graphql/types/relay.rb +2 -1
- data/lib/graphql/types/string.rb +4 -1
- data/lib/graphql/types.rb +2 -1
- 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 +3 -2
- data/lib/graphql.rb +1 -0
- metadata +3 -4
- data/lib/graphql/query/variables.rb +0 -99
- data/lib/graphql/static_validation/literal_validator.rb +0 -157
|
@@ -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
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
require "graphql/pagination/relation_connection"
|
|
4
5
|
|
|
5
6
|
module GraphQL
|
|
6
7
|
module Pagination
|
|
7
8
|
class MongoidRelationConnection < Pagination::RelationConnection
|
|
9
|
+
#: (untyped relation) -> Integer?
|
|
8
10
|
def relation_offset(relation)
|
|
9
11
|
relation.options.skip
|
|
10
12
|
end
|
|
11
13
|
|
|
14
|
+
#: (untyped relation) -> Integer?
|
|
12
15
|
def relation_limit(relation)
|
|
13
16
|
relation.options.limit
|
|
14
17
|
end
|
|
15
18
|
|
|
19
|
+
#: (untyped relation) -> Integer
|
|
16
20
|
def relation_count(relation)
|
|
17
21
|
relation.all.count(relation.options.slice(:limit, :skip))
|
|
18
22
|
end
|
|
19
23
|
|
|
24
|
+
#: (untyped relation) -> untyped
|
|
20
25
|
def null_relation(relation)
|
|
21
26
|
relation.without_options.none
|
|
22
27
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
#--
|
|
2
3
|
# typed: true
|
|
3
4
|
require "graphql/pagination/connection"
|
|
4
5
|
require "monitor"
|
|
@@ -159,10 +160,10 @@ module GraphQL
|
|
|
159
160
|
# - `Integer`
|
|
160
161
|
#
|
|
161
162
|
# :call-seq:
|
|
162
|
-
# offset_from_cursor(cursor) -> Integer
|
|
163
|
-
def offset_from_cursor(cursor)
|
|
163
|
+
# offset_from_cursor(cursor, allow_zero:) -> Integer
|
|
164
|
+
def offset_from_cursor(cursor, allow_zero: false)
|
|
164
165
|
offset = Integer(decode(cursor), 10, exception: false) #: Integer?
|
|
165
|
-
if offset.nil? || offset
|
|
166
|
+
if offset.nil? || offset < 0 || (offset == 0 && !allow_zero) || offset > MAX_OFFSET ||
|
|
166
167
|
offset + (relation_offset(items) || 0) > MAX_OFFSET
|
|
167
168
|
raise GraphQL::ExecutionError, "Invalid cursor: #{cursor.inspect}"
|
|
168
169
|
end
|
|
@@ -262,7 +263,7 @@ module GraphQL
|
|
|
262
263
|
# :call-seq:
|
|
263
264
|
# after_offset() -> Integer | nil
|
|
264
265
|
def after_offset
|
|
265
|
-
@after_offset ||= after && offset_from_cursor(after)
|
|
266
|
+
@after_offset ||= after && offset_from_cursor(after, allow_zero: true)
|
|
266
267
|
end
|
|
267
268
|
|
|
268
269
|
# Apply `first` and `last` to `sliced_nodes`,
|
|
@@ -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,19 +9,23 @@ module GraphQL
|
|
|
8
9
|
class SequelDatasetConnection < Pagination::RelationConnection
|
|
9
10
|
private
|
|
10
11
|
|
|
12
|
+
#: (untyped relation) -> Integer?
|
|
11
13
|
def relation_offset(relation)
|
|
12
14
|
relation.opts[:offset]
|
|
13
15
|
end
|
|
14
16
|
|
|
17
|
+
#: (untyped relation) -> Integer?
|
|
15
18
|
def relation_limit(relation)
|
|
16
19
|
relation.opts[:limit]
|
|
17
20
|
end
|
|
18
21
|
|
|
22
|
+
#: (untyped relation) -> Integer
|
|
19
23
|
def relation_count(relation)
|
|
20
24
|
# Remove order to make it faster
|
|
21
25
|
relation.order(nil).count
|
|
22
26
|
end
|
|
23
27
|
|
|
28
|
+
#: (untyped relation) -> untyped
|
|
24
29
|
def null_relation(relation)
|
|
25
30
|
relation.where(false)
|
|
26
31
|
end
|
data/lib/graphql/pagination.rb
CHANGED
data/lib/graphql/parse_error.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
|
|
4
5
|
require 'digest/sha2'
|
|
5
6
|
|
|
@@ -20,6 +21,7 @@ module GraphQL
|
|
|
20
21
|
#
|
|
21
22
|
# :call-seq:
|
|
22
23
|
# generate(input_str) -> String
|
|
24
|
+
#: (String input_str) -> String
|
|
23
25
|
def self.generate(input_str)
|
|
24
26
|
# Implemented to be:
|
|
25
27
|
# - Short (and uniform) length
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
#--
|
|
2
3
|
# typed: true
|
|
3
4
|
module GraphQL
|
|
4
5
|
class Query
|
|
@@ -11,9 +12,52 @@ module GraphQL
|
|
|
11
12
|
result
|
|
12
13
|
end
|
|
13
14
|
|
|
15
|
+
# Build a valid result which carries the coerced Ruby value for this input.
|
|
16
|
+
#
|
|
17
|
+
# Return this from `validate_non_null_input` to give GraphQL-Ruby the coerced value,
|
|
18
|
+
# so that it doesn't call `coerce_input` again. `value` may be `nil`.
|
|
19
|
+
#
|
|
20
|
+
# **Parameters**
|
|
21
|
+
#
|
|
22
|
+
# - `value` (`Object`) — The coerced Ruby value
|
|
23
|
+
#
|
|
24
|
+
# **Returns**
|
|
25
|
+
#
|
|
26
|
+
# - `GraphQL::Query::InputValidationResult`
|
|
27
|
+
#
|
|
28
|
+
# :call-seq:
|
|
29
|
+
# coerced(Object value) -> GraphQL::Query::InputValidationResult
|
|
30
|
+
def self.coerced(value)
|
|
31
|
+
result = self.new
|
|
32
|
+
result.coerced_value = value
|
|
33
|
+
result
|
|
34
|
+
end
|
|
35
|
+
|
|
14
36
|
def initialize(valid: true, problems: nil)
|
|
15
37
|
@valid = valid
|
|
16
38
|
@problems = problems
|
|
39
|
+
@coerced_value = nil
|
|
40
|
+
@has_coerced_value = false
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# **Returns**
|
|
44
|
+
#
|
|
45
|
+
# - `Object` — The coerced value, if one was given with [coerced_value=](rdoc-ref:#coerced_value=)
|
|
46
|
+
attr_reader :coerced_value
|
|
47
|
+
|
|
48
|
+
def coerced_value=(new_value)
|
|
49
|
+
@coerced_value = new_value
|
|
50
|
+
@has_coerced_value = true
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# **Returns**
|
|
54
|
+
#
|
|
55
|
+
# - `Boolean` — true if a coerced value was given with [coerced_value=](rdoc-ref:#coerced_value=)
|
|
56
|
+
#
|
|
57
|
+
# :call-seq:
|
|
58
|
+
# coerced_value?() -> bool
|
|
59
|
+
def coerced_value?
|
|
60
|
+
@has_coerced_value
|
|
17
61
|
end
|
|
18
62
|
|
|
19
63
|
def valid?
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
#--
|
|
2
3
|
# typed: true
|
|
3
4
|
module GraphQL
|
|
4
5
|
class Query
|
|
@@ -102,6 +103,10 @@ module GraphQL
|
|
|
102
103
|
@query.variables
|
|
103
104
|
end
|
|
104
105
|
|
|
106
|
+
def input_values
|
|
107
|
+
@query.input_values
|
|
108
|
+
end
|
|
109
|
+
|
|
105
110
|
def fragments
|
|
106
111
|
@query.fragments
|
|
107
112
|
end
|
data/lib/graphql/query/result.rb
CHANGED
data/lib/graphql/query.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
#--
|
|
2
3
|
# typed: true
|
|
3
4
|
|
|
4
5
|
module GraphQL
|
|
@@ -47,7 +48,6 @@ module GraphQL
|
|
|
47
48
|
autoload :NullContext, "graphql/query/null_context"
|
|
48
49
|
autoload :Partial, "graphql/query/partial"
|
|
49
50
|
autoload :Result, "graphql/query/result"
|
|
50
|
-
autoload :Variables, "graphql/query/variables"
|
|
51
51
|
autoload :InputValidationResult, "graphql/query/input_validation_result"
|
|
52
52
|
autoload :VariableValidationError, "graphql/query/variable_validation_error"
|
|
53
53
|
autoload :ValidationPipeline, "graphql/query/validation_pipeline"
|
|
@@ -236,6 +236,7 @@ module GraphQL
|
|
|
236
236
|
@root_value = root_value
|
|
237
237
|
@fragments = nil
|
|
238
238
|
@operations = nil
|
|
239
|
+
@input_values = nil
|
|
239
240
|
@finalizers = @top_level_finalizers = nil
|
|
240
241
|
@validate = validate
|
|
241
242
|
self.static_validator = static_validator if static_validator
|
|
@@ -332,6 +333,10 @@ module GraphQL
|
|
|
332
333
|
end
|
|
333
334
|
end
|
|
334
335
|
|
|
336
|
+
def input_values # :nodoc:
|
|
337
|
+
@input_values ||= Execution::InputValues.new(self)
|
|
338
|
+
end
|
|
339
|
+
|
|
335
340
|
def result_values=(result_hash) # :nodoc:
|
|
336
341
|
if @executed
|
|
337
342
|
raise "Invariant: Can't reassign result"
|
|
@@ -424,20 +429,12 @@ module GraphQL
|
|
|
424
429
|
#
|
|
425
430
|
# **Returns**
|
|
426
431
|
#
|
|
427
|
-
# - `GraphQL::
|
|
432
|
+
# - `GraphQL::Execution::VariableValues` — Variables to apply to this query
|
|
428
433
|
#
|
|
429
434
|
# :call-seq:
|
|
430
|
-
# variables() -> GraphQL::
|
|
435
|
+
# variables() -> GraphQL::Execution::VariableValues
|
|
431
436
|
def variables
|
|
432
|
-
@variables ||=
|
|
433
|
-
with_prepared_ast {
|
|
434
|
-
GraphQL::Query::Variables.new(
|
|
435
|
-
@context,
|
|
436
|
-
@ast_variables,
|
|
437
|
-
@provided_variables,
|
|
438
|
-
)
|
|
439
|
-
}
|
|
440
|
-
end
|
|
437
|
+
@variables ||= with_prepared_ast { input_values.variable_values }
|
|
441
438
|
end
|
|
442
439
|
|
|
443
440
|
# A version of the given query string, with:
|
data/lib/graphql/railtie.rb
CHANGED
data/lib/graphql/rake_task.rb
CHANGED
data/lib/graphql/relay.rb
CHANGED
data/lib/graphql/rubocop.rb
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
module GraphQL
|
|
4
5
|
class Schema
|
|
5
6
|
module AlwaysVisible
|
|
7
|
+
#: (singleton(GraphQL::Schema) schema, **untyped opts) -> void
|
|
6
8
|
def self.use(schema, **opts)
|
|
7
9
|
schema.use(GraphQL::Schema::Visibility, profiles: { nil => {} })
|
|
8
10
|
schema.extend(self)
|
|
9
11
|
end
|
|
10
12
|
|
|
13
|
+
#: (untyped _member, GraphQL::Query::Context _context) -> bool
|
|
11
14
|
def visible?(_member, _context)
|
|
12
15
|
true
|
|
13
16
|
end
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
require "base64"
|
|
4
5
|
module GraphQL
|
|
5
6
|
class Schema
|
|
6
7
|
module Base64Encoder # :nodoc:
|
|
8
|
+
#: (String unencoded_text, ?nonce: bool) -> String
|
|
7
9
|
def self.encode(unencoded_text, nonce: false)
|
|
8
10
|
Base64.urlsafe_encode64(unencoded_text, padding: false)
|
|
9
11
|
end
|
|
10
12
|
|
|
13
|
+
#: (String encoded_text, ?nonce: bool) -> String
|
|
11
14
|
def self.decode(encoded_text, nonce: false)
|
|
12
15
|
# urlsafe_decode64 is for forward compatibility
|
|
13
16
|
Base64.urlsafe_decode64(encoded_text)
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
module GraphQL
|
|
4
5
|
class Schema
|
|
5
6
|
module BuildFromDefinition
|
|
6
7
|
class ResolveMap
|
|
7
8
|
class DefaultResolve
|
|
9
|
+
#: (Hash[String, untyped] field_map, String field_name) -> void
|
|
8
10
|
def initialize(field_map, field_name)
|
|
9
|
-
@field_map = field_map
|
|
10
|
-
@field_name = field_name
|
|
11
|
+
@field_map = field_map #: Hash[String, untyped]
|
|
12
|
+
@field_name = field_name #: String
|
|
11
13
|
end
|
|
12
14
|
|
|
13
15
|
# Make some runtime checks about
|
|
@@ -18,6 +20,7 @@ module GraphQL
|
|
|
18
20
|
# - call the implementation now (to satisfy this field execution)
|
|
19
21
|
#
|
|
20
22
|
# If `obj` doesn't implement `field_name`, raise an error.
|
|
23
|
+
#: (untyped obj, untyped args, GraphQL::Query::Context ctx) -> untyped
|
|
21
24
|
def call(obj, args, ctx)
|
|
22
25
|
method_name = @field_name
|
|
23
26
|
if !obj.respond_to?(method_name)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
module GraphQL
|
|
4
5
|
class Schema
|
|
5
6
|
BUILT_IN_TYPES = {
|
|
@@ -8,6 +9,6 @@ module GraphQL
|
|
|
8
9
|
"Float" => GraphQL::Types::Float,
|
|
9
10
|
"Boolean" => GraphQL::Types::Boolean,
|
|
10
11
|
"ID" => GraphQL::Types::ID,
|
|
11
|
-
}
|
|
12
|
+
} #: Hash[String, GraphQL::Schema::Member::type_definition]
|
|
12
13
|
end
|
|
13
14
|
end
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
module GraphQL
|
|
4
5
|
class Schema
|
|
5
6
|
class Directive < GraphQL::Schema::Member
|
|
@@ -7,6 +8,7 @@ module GraphQL
|
|
|
7
8
|
#
|
|
8
9
|
# In this case, the server hides types and fields _entirely_, unless the current context has certain `:flags` present.
|
|
9
10
|
class Flagged < GraphQL::Schema::Directive
|
|
11
|
+
#: (untyped target, **untyped options) -> void
|
|
10
12
|
def initialize(target, **options)
|
|
11
13
|
if target.is_a?(Module)
|
|
12
14
|
# This is type class of some kind, `include` will put this module
|
|
@@ -45,10 +47,12 @@ module GraphQL
|
|
|
45
47
|
# @requires_ancestor: GraphQL::Schema::Member::HasDirectives
|
|
46
48
|
|
|
47
49
|
module VisibleByFlag
|
|
50
|
+
#: (Module[untyped] schema_class) -> void
|
|
48
51
|
def self.included(schema_class)
|
|
49
52
|
schema_class.extend(self)
|
|
50
53
|
end
|
|
51
54
|
|
|
55
|
+
#: (GraphQL::Query::Context context) -> bool
|
|
52
56
|
def visible?(context)
|
|
53
57
|
if dir = self.directives.find { |d| d.is_a?(Flagged) }
|
|
54
58
|
relevant_flags = (f = context[:flags]) && dir.arguments[:by] & f # rubocop:disable Development/ContextIsPassedCop -- definition-related
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
module GraphQL
|
|
4
5
|
class Schema
|
|
5
6
|
class Directive < GraphQL::Schema::Member
|
|
@@ -17,6 +18,7 @@ module GraphQL
|
|
|
17
18
|
|
|
18
19
|
default_directive true
|
|
19
20
|
|
|
21
|
+
#: (Hash[Symbol, untyped] args, GraphQL::Query::Context ctx) -> bool
|
|
20
22
|
def self.static_include?(args, ctx)
|
|
21
23
|
!!args[:if]
|
|
22
24
|
end
|