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/schema/member/base_dsl_methods'
|
|
4
5
|
require 'graphql/schema/member/graphql_type_names'
|
|
5
6
|
require 'graphql/schema/member/has_ast_node'
|
|
@@ -23,7 +24,7 @@ module GraphQL
|
|
|
23
24
|
#
|
|
24
25
|
class Member # :nodoc:
|
|
25
26
|
# A module that defines a GraphQL interface type (it includes `GraphQL::Schema::Interface`).
|
|
26
|
-
#: type interface_definition = GraphQL::Schema::Interface::DefinitionMethods & Module
|
|
27
|
+
#: type interface_definition = GraphQL::Schema::Interface::DefinitionMethods & Module[untyped]
|
|
27
28
|
|
|
28
29
|
# A class or module that defines a GraphQL type:
|
|
29
30
|
# an object, union, enum, scalar or input object class, or an interface module.
|
|
@@ -40,6 +41,7 @@ module GraphQL
|
|
|
40
41
|
extend HasAstNode
|
|
41
42
|
extend HasDirectives
|
|
42
43
|
|
|
44
|
+
#: (GraphQL::Query::Context _ctx) -> bool
|
|
43
45
|
def self.authorizes?(_ctx)
|
|
44
46
|
false
|
|
45
47
|
end
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
|
|
4
5
|
module GraphQL
|
|
5
6
|
class Schema
|
|
@@ -67,6 +68,8 @@ module GraphQL
|
|
|
67
68
|
extend GraphQL::Schema::Member::HasFields
|
|
68
69
|
extend GraphQL::Schema::Resolver::HasPayloadType
|
|
69
70
|
|
|
71
|
+
# Returns the application's resolved value.
|
|
72
|
+
#: (Hash[Symbol, untyped] _args_hash) -> untyped
|
|
70
73
|
def call_resolve(_args_hash) # :nodoc:
|
|
71
74
|
# Clear any cached values from `loads` or authorization:
|
|
72
75
|
dataloader.clear_cache
|
|
@@ -74,17 +77,20 @@ module GraphQL
|
|
|
74
77
|
end
|
|
75
78
|
|
|
76
79
|
class << self
|
|
80
|
+
#: (GraphQL::Query::Context context) -> bool
|
|
77
81
|
def visible?(context)
|
|
78
82
|
true
|
|
79
83
|
end
|
|
80
84
|
|
|
81
85
|
private
|
|
82
86
|
|
|
87
|
+
#: (GraphQL::Schema::Field field_defn) -> String
|
|
83
88
|
def conflict_field_name_warning(field_defn)
|
|
84
89
|
"#{self.graphql_name}'s `field :#{field_defn.name}` conflicts with a built-in method, use `hash_key:` or `method:` to pick a different resolve behavior for this field (for example, `hash_key: :#{field_defn.resolver_method}_value`, and modify the return hash). Or use `method_conflict_warning: false` to suppress this warning."
|
|
85
90
|
end
|
|
86
91
|
|
|
87
92
|
# Override this to attach self as `mutation`
|
|
93
|
+
#: () -> singleton(GraphQL::Schema::Object)
|
|
88
94
|
def generate_payload_type
|
|
89
95
|
payload_class = super
|
|
90
96
|
payload_class.mutation(self)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
#--
|
|
2
3
|
# typed: true
|
|
3
4
|
|
|
4
5
|
require "graphql/query/null_context"
|
|
@@ -89,7 +90,7 @@ module GraphQL
|
|
|
89
90
|
# authorized_new(Object object, GraphQL::Query::Context context) -> GraphQL::Schema::Object | GraphQL::Execution::Lazy | GraphQL::UnauthorizedError
|
|
90
91
|
def authorized_new(object, context)
|
|
91
92
|
context.query.current_trace.begin_authorized(self, object, context)
|
|
92
|
-
raised_auth_err = nil
|
|
93
|
+
raised_auth_err = nil #: GraphQL::UnauthorizedError?
|
|
93
94
|
begin
|
|
94
95
|
maybe_lazy_auth_val = context.query.current_trace.authorized(query: context.query, type: self, object: object) do
|
|
95
96
|
begin
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
|
|
4
5
|
module GraphQL
|
|
5
6
|
class Schema
|
|
@@ -31,6 +32,7 @@ module GraphQL
|
|
|
31
32
|
|
|
32
33
|
# Override [resolve_with_support](rdoc-ref:#resolve_with_support) to
|
|
33
34
|
# delete `client_mutation_id` from the kwargs.
|
|
35
|
+
#: (**untyped inputs) -> untyped
|
|
34
36
|
def resolve_with_support(**inputs)
|
|
35
37
|
input = inputs[:input].to_kwargs
|
|
36
38
|
|
|
@@ -51,12 +53,15 @@ module GraphQL
|
|
|
51
53
|
end
|
|
52
54
|
end
|
|
53
55
|
|
|
56
|
+
#: -> void
|
|
54
57
|
def call
|
|
55
|
-
|
|
58
|
+
# The runtime prepares arguments before calling this
|
|
59
|
+
prepared_arguments = @prepared_arguments #: as !nil
|
|
60
|
+
input = prepared_arguments[:input]&.to_kwargs
|
|
56
61
|
|
|
57
62
|
if input
|
|
58
63
|
client_mutation_id = input.delete(:client_mutation_id)
|
|
59
|
-
|
|
64
|
+
prepared_arguments[:input] = input
|
|
60
65
|
end
|
|
61
66
|
|
|
62
67
|
super
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
#--
|
|
2
3
|
# typed: true
|
|
3
4
|
require "graphql/schema/resolver/has_payload_type"
|
|
4
5
|
|
|
@@ -25,6 +26,7 @@ module GraphQL
|
|
|
25
26
|
extend Schema::Member::BaseDSLMethods
|
|
26
27
|
extend GraphQL::Schema::Member::HasArguments
|
|
27
28
|
extend GraphQL::Schema::Member::HasAuthorization
|
|
29
|
+
extend GraphQL::Schema::Member::HasAuthorization::ClassConfigured
|
|
28
30
|
extend GraphQL::Schema::Member::HasValidators
|
|
29
31
|
include Schema::Member::HasPath
|
|
30
32
|
extend Schema::Member::HasPath
|
|
@@ -49,7 +51,7 @@ module GraphQL
|
|
|
49
51
|
context.types.arguments(self.class).each do |arg|
|
|
50
52
|
@arguments_by_keyword[arg.keyword] = arg
|
|
51
53
|
end
|
|
52
|
-
@prepared_arguments = nil
|
|
54
|
+
@prepared_arguments = nil #: Hash[Symbol, untyped]?
|
|
53
55
|
end
|
|
54
56
|
|
|
55
57
|
attr_accessor :exec_result, :exec_index, :field_resolve_step, :raw_arguments
|
|
@@ -125,7 +127,7 @@ module GraphQL
|
|
|
125
127
|
exec_result[exec_index] = err
|
|
126
128
|
rescue StandardError => stderr
|
|
127
129
|
exec_result[exec_index] = begin
|
|
128
|
-
context.query.handle_or_reraise(stderr)
|
|
130
|
+
context.query.handle_or_reraise(stderr, field: @field, arguments: @prepared_arguments, object: object)
|
|
129
131
|
rescue GraphQL::ExecutionError => ex_err
|
|
130
132
|
ex_err
|
|
131
133
|
end
|
|
@@ -265,7 +267,7 @@ module GraphQL
|
|
|
265
267
|
end
|
|
266
268
|
|
|
267
269
|
def self.authorizes?(context)
|
|
268
|
-
self.instance_method(:authorized?).owner != GraphQL::Schema::Resolver
|
|
270
|
+
self.instance_method(:authorized?).owner != GraphQL::Schema::Resolver || super
|
|
269
271
|
end
|
|
270
272
|
|
|
271
273
|
# Called when an object loaded by `loads:` fails the `.authorized?` check for its resolved GraphQL object type.
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
module GraphQL
|
|
4
5
|
class Schema
|
|
5
6
|
class Scalar < GraphQL::Schema::Member
|
|
6
7
|
extend GraphQL::Schema::Member::ValidatesInput
|
|
7
8
|
|
|
8
9
|
class << self
|
|
10
|
+
#: (untyped val, GraphQL::Query::Context ctx) -> untyped
|
|
9
11
|
def coerce_input(val, ctx)
|
|
10
12
|
val
|
|
11
13
|
end
|
|
12
14
|
|
|
15
|
+
#: (untyped val, GraphQL::Query::Context ctx) -> untyped
|
|
13
16
|
def coerce_result(val, ctx)
|
|
14
17
|
val
|
|
15
18
|
end
|
|
16
19
|
|
|
20
|
+
#: -> GraphQL::TypeKinds::TypeKind
|
|
17
21
|
def kind
|
|
18
22
|
GraphQL::TypeKinds::SCALAR
|
|
19
23
|
end
|
|
20
24
|
|
|
25
|
+
#: (?String? new_url) -> String?
|
|
21
26
|
def specified_by_url(new_url = nil)
|
|
22
27
|
if new_url
|
|
23
28
|
directive(GraphQL::Schema::Directive::SpecifiedBy, url: new_url)
|
|
@@ -30,17 +35,36 @@ module GraphQL
|
|
|
30
35
|
end
|
|
31
36
|
end
|
|
32
37
|
|
|
38
|
+
#: (?bool? is_default) -> bool?
|
|
33
39
|
def default_scalar(is_default = nil)
|
|
34
40
|
if !is_default.nil?
|
|
35
|
-
@default_scalar = is_default
|
|
41
|
+
@default_scalar = is_default #: bool?
|
|
36
42
|
end
|
|
37
43
|
@default_scalar
|
|
38
44
|
end
|
|
39
45
|
|
|
46
|
+
#: -> bool
|
|
40
47
|
def default_scalar?
|
|
41
48
|
@default_scalar ||= false
|
|
42
49
|
end
|
|
43
50
|
|
|
51
|
+
# Coerce `value` with [coerce_input](rdoc-ref:::coerce_input) and report any problems.
|
|
52
|
+
#
|
|
53
|
+
# GraphQL-Ruby calls this for variable and literal input values. When the value is valid,
|
|
54
|
+
# it returns a result with [coerced_value](rdoc-ref:GraphQL::Query::InputValidationResult#coerced_value),
|
|
55
|
+
# which is used as the argument value.
|
|
56
|
+
#
|
|
57
|
+
# Overrides may return `InputValidationResult.coerced(value)` to provide a coerced value (including `nil`).
|
|
58
|
+
# If an override returns a valid result _without_ a coerced value, `coerce_input` will be called at runtime,
|
|
59
|
+
# and any `GraphQL::CoercionError` it raises will be added as a field error.
|
|
60
|
+
#
|
|
61
|
+
# **Returns**
|
|
62
|
+
#
|
|
63
|
+
# - `GraphQL::Query::InputValidationResult, nil`
|
|
64
|
+
#
|
|
65
|
+
# :call-seq:
|
|
66
|
+
# validate_non_null_input(value, ctx, max_errors:) -> GraphQL::Query::InputValidationResult | nil
|
|
67
|
+
#: (untyped value, GraphQL::Query::Context ctx, ?max_errors: Integer?) -> GraphQL::Query::InputValidationResult?
|
|
44
68
|
def validate_non_null_input(value, ctx, max_errors: nil)
|
|
45
69
|
coerced_result = begin
|
|
46
70
|
coerce_input(value, ctx)
|
|
@@ -55,7 +79,7 @@ module GraphQL
|
|
|
55
79
|
elsif coerced_result.is_a?(GraphQL::CoercionError)
|
|
56
80
|
Query::InputValidationResult.from_problem(coerced_result.message, message: coerced_result.message, extensions: coerced_result.extensions)
|
|
57
81
|
else
|
|
58
|
-
|
|
82
|
+
Query::InputValidationResult.coerced(coerced_result)
|
|
59
83
|
end
|
|
60
84
|
end
|
|
61
85
|
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
|
module TypeExpression # :nodoc:
|
|
@@ -17,6 +18,7 @@ module GraphQL
|
|
|
17
18
|
#
|
|
18
19
|
# :call-seq:
|
|
19
20
|
# build_type(#type type_owner, GraphQL::Language::Nodes::AbstractNode ast_node) -> Class | GraphQL::Schema::NonNull | GraphQL::Schema:List
|
|
21
|
+
#: (GraphQL::Schema::Visibility::Profile | GraphQL::Schema::Warden::VisibilityProfile type_owner, GraphQL::Language::Nodes::AbstractNode ast_node) -> (GraphQL::Schema::Member::type_definition | GraphQL::Schema::NonNull | GraphQL::Schema::List | nil)
|
|
20
22
|
def self.build_type(type_owner, ast_node)
|
|
21
23
|
case ast_node
|
|
22
24
|
when GraphQL::Language::Nodes::TypeName
|
|
@@ -37,6 +39,7 @@ module GraphQL
|
|
|
37
39
|
class << self
|
|
38
40
|
private
|
|
39
41
|
|
|
42
|
+
#: (GraphQL::Schema::Member::type_definition | GraphQL::Schema::NonNull | GraphQL::Schema::List | nil type, Symbol wrapper_method) -> (GraphQL::Schema::NonNull | GraphQL::Schema::List | nil)
|
|
40
43
|
def wrap_type(type, wrapper_method)
|
|
41
44
|
if type.nil?
|
|
42
45
|
nil
|
data/lib/graphql/schema/union.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
|
|
4
5
|
module GraphQL
|
|
5
6
|
class Schema
|
|
@@ -29,16 +30,19 @@ module GraphQL
|
|
|
29
30
|
# validates: { all: { inclusion: { in: 1..12 } } }
|
|
30
31
|
# ```
|
|
31
32
|
class AllValidator < Validator
|
|
33
|
+
# `validators` is configuration for other validators, for example `{ format: { with: /.../ } }`.
|
|
34
|
+
#: (validated: GraphQL::Schema::Argument | GraphQL::Schema::Field | singleton(GraphQL::Schema::Resolver) | singleton(GraphQL::Schema::InputObject), ?allow_blank: bool, ?allow_null: bool, **untyped validators) -> void
|
|
32
35
|
def initialize(validated:, allow_blank: false, allow_null: false, **validators)
|
|
33
36
|
super(validated: validated, allow_blank: allow_blank, allow_null: allow_null)
|
|
34
37
|
|
|
35
|
-
@validators = Validator.from_config(validated, validators)
|
|
38
|
+
@validators = Validator.from_config(validated, validators) #: Array[GraphQL::Schema::Validator]
|
|
36
39
|
end
|
|
37
40
|
|
|
41
|
+
#: (untyped object, GraphQL::Query::Context context, untyped value) -> Array[String]
|
|
38
42
|
def validate(object, context, value)
|
|
39
43
|
return EMPTY_ARRAY if permitted_empty_value?(value)
|
|
40
44
|
|
|
41
|
-
all_errors = EMPTY_ARRAY
|
|
45
|
+
all_errors = EMPTY_ARRAY #: Array[String]
|
|
42
46
|
|
|
43
47
|
value.each do |subvalue|
|
|
44
48
|
@validators.each do |validator|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
|
|
4
5
|
module GraphQL
|
|
5
6
|
class Schema
|
|
@@ -14,12 +15,14 @@ module GraphQL
|
|
|
14
15
|
# argument :name, String, required: true, validate: { allow_blank: false }
|
|
15
16
|
# ```
|
|
16
17
|
class AllowBlankValidator < Validator
|
|
18
|
+
#: (?(bool | Proc | nil) allow_blank_positional, ?allow_blank: bool | Proc | nil, ?message: String | Proc, **untyped default_options) -> void
|
|
17
19
|
def initialize(allow_blank_positional = nil, allow_blank: nil, message: "%{validated} can't be blank", **default_options)
|
|
18
|
-
@message = message
|
|
20
|
+
@message = message #: String | Proc
|
|
19
21
|
super(**default_options)
|
|
20
22
|
@allow_blank = allow_blank.nil? ? allow_blank_positional : allow_blank
|
|
21
23
|
end
|
|
22
24
|
|
|
25
|
+
#: (untyped _object, GraphQL::Query::Context _context, untyped value) -> String?
|
|
23
26
|
def validate(_object, _context, value)
|
|
24
27
|
if value.respond_to?(:blank?) && value.blank?
|
|
25
28
|
if (value.nil? && validation_parameter(@allow_null)) || validation_parameter(@allow_blank)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
|
|
4
5
|
module GraphQL
|
|
5
6
|
class Schema
|
|
@@ -14,13 +15,15 @@ module GraphQL
|
|
|
14
15
|
# argument :name, String, required: false, validates: { allow_null: false }
|
|
15
16
|
# ```
|
|
16
17
|
class AllowNullValidator < Validator
|
|
17
|
-
MESSAGE = "%{validated} can't be null"
|
|
18
|
+
MESSAGE = "%{validated} can't be null" #: String
|
|
19
|
+
#: (?(bool | Proc | nil) allow_null_positional, ?allow_null: bool | Proc | nil, ?message: String | Proc, **untyped default_options) -> void
|
|
18
20
|
def initialize(allow_null_positional = nil, allow_null: nil, message: MESSAGE, **default_options)
|
|
19
|
-
@message = message
|
|
21
|
+
@message = message #: String | Proc
|
|
20
22
|
super(**default_options)
|
|
21
23
|
@allow_null = allow_null.nil? ? allow_null_positional : allow_null
|
|
22
24
|
end
|
|
23
25
|
|
|
26
|
+
#: (untyped _object, GraphQL::Query::Context _context, untyped value) -> String?
|
|
24
27
|
def validate(_object, _context, value)
|
|
25
28
|
if value.nil? && !validation_parameter(@allow_null)
|
|
26
29
|
validation_parameter(@message)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
|
|
4
5
|
module GraphQL
|
|
5
6
|
class Schema
|
|
@@ -22,13 +23,15 @@ module GraphQL
|
|
|
22
23
|
#
|
|
23
24
|
# :call-seq:
|
|
24
25
|
# initialize(String message:, Array in:, **default_options)
|
|
25
|
-
|
|
26
|
+
#: (in: Array[untyped] | Proc, ?message: String | Proc, **untyped default_options) -> void
|
|
27
|
+
def initialize(in:, message: "%{validated} is reserved", **default_options)
|
|
26
28
|
# `in` is a reserved word, so work around that
|
|
27
|
-
@in_list = binding.local_variable_get(:in)
|
|
28
|
-
@message = message
|
|
29
|
+
@in_list = binding.local_variable_get(:in) #: Array[untyped] | Proc
|
|
30
|
+
@message = message #: String | Proc
|
|
29
31
|
super(**default_options)
|
|
30
32
|
end
|
|
31
33
|
|
|
34
|
+
#: (untyped _object, GraphQL::Query::Context _context, untyped value) -> String?
|
|
32
35
|
def validate(_object, _context, value)
|
|
33
36
|
if permitted_empty_value?(value)
|
|
34
37
|
# pass
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
|
|
4
5
|
module GraphQL
|
|
5
6
|
class Schema
|
|
@@ -32,18 +33,20 @@ module GraphQL
|
|
|
32
33
|
#
|
|
33
34
|
# :call-seq:
|
|
34
35
|
# initialize(RegExp | nil with:, Regexp | nil without:, String message:, **default_options)
|
|
36
|
+
#: (?with: Regexp | Proc | nil, ?without: Regexp | Proc | nil, ?message: String | Proc, **untyped default_options) -> void
|
|
35
37
|
def initialize(
|
|
36
38
|
with: nil,
|
|
37
39
|
without: nil,
|
|
38
40
|
message: "%{validated} is invalid",
|
|
39
41
|
**default_options
|
|
40
42
|
)
|
|
41
|
-
@with_pattern = with
|
|
42
|
-
@without_pattern = without
|
|
43
|
-
@message = message
|
|
43
|
+
@with_pattern = with #: Regexp | Proc | nil
|
|
44
|
+
@without_pattern = without #: Regexp | Proc | nil
|
|
45
|
+
@message = message #: String | Proc
|
|
44
46
|
super(**default_options)
|
|
45
47
|
end
|
|
46
48
|
|
|
49
|
+
#: (untyped _object, GraphQL::Query::Context _context, untyped value) -> String?
|
|
47
50
|
def validate(_object, _context, value)
|
|
48
51
|
if permitted_empty_value?(value)
|
|
49
52
|
# Do nothing
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
2
|
+
#--
|
|
3
|
+
# typed: strict
|
|
3
4
|
|
|
4
5
|
module GraphQL
|
|
5
6
|
class Schema
|
|
@@ -24,13 +25,15 @@ module GraphQL
|
|
|
24
25
|
#
|
|
25
26
|
# :call-seq:
|
|
26
27
|
# initialize(Array in:, String message:, **default_options)
|
|
28
|
+
#: (in: Array[untyped] | Proc, ?message: String | Proc, **untyped default_options) -> void
|
|
27
29
|
def initialize(in:, message: "%{validated} is not included in the list", **default_options)
|
|
28
30
|
# `in` is a reserved word, so work around that
|
|
29
|
-
@in_list = binding.local_variable_get(:in)
|
|
30
|
-
@message = message
|
|
31
|
+
@in_list = binding.local_variable_get(:in) #: Array[untyped] | Proc
|
|
32
|
+
@message = message #: String | Proc
|
|
31
33
|
super(**default_options)
|
|
32
34
|
end
|
|
33
35
|
|
|
36
|
+
#: (untyped _object, GraphQL::Query::Context _context, untyped value) -> String?
|
|
34
37
|
def validate(_object, _context, value)
|
|
35
38
|
if permitted_empty_value?(value)
|
|
36
39
|
# pass
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
#--
|
|
2
3
|
# typed: true
|
|
3
4
|
|
|
4
5
|
module GraphQL
|
|
@@ -21,8 +22,8 @@ module GraphQL
|
|
|
21
22
|
# initialize(GraphQL::Schema::Argument | GraphQL::Schema::Field | GraphQL::Schema::Resolver | Class[GraphQL::Schema::InputObject] validated:, bool allow_blank:, bool allow_null:)
|
|
22
23
|
def initialize(validated:, allow_blank: false, allow_null: false)
|
|
23
24
|
@validated = validated
|
|
24
|
-
@allow_blank = allow_blank
|
|
25
|
-
@allow_null = allow_null
|
|
25
|
+
@allow_blank = allow_blank #: bool | Proc | nil
|
|
26
|
+
@allow_null = allow_null #: bool | Proc | nil
|
|
26
27
|
end
|
|
27
28
|
|
|
28
29
|
# **Parameters**
|
data/lib/graphql/schema.rb
CHANGED