graphql 2.6.11 → 2.6.13
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/.rdoc_options +4 -0
- 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 +8 -2
- data/lib/generators/graphql/mutation_create_generator.rb +8 -2
- data/lib/generators/graphql/mutation_delete_generator.rb +8 -2
- data/lib/generators/graphql/mutation_generator.rb +8 -2
- data/lib/generators/graphql/mutation_update_generator.rb +8 -2
- data/lib/generators/graphql/object_generator.rb +1 -0
- data/lib/generators/graphql/orm_mutations_base.rb +8 -2
- 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 +38 -8
- data/lib/generators/graphql/union_generator.rb +1 -0
- data/lib/graphql/analysis/analyzer.rb +35 -9
- data/lib/graphql/analysis/field_usage.rb +1 -0
- data/lib/graphql/analysis/max_query_complexity.rb +2 -1
- data/lib/graphql/analysis/max_query_depth.rb +1 -0
- data/lib/graphql/analysis/query_complexity.rb +57 -20
- data/lib/graphql/analysis/query_depth.rb +17 -12
- data/lib/graphql/analysis/visitor.rb +79 -16
- data/lib/graphql/analysis.rb +23 -6
- data/lib/graphql/analysis_error.rb +1 -0
- data/lib/graphql/autoload.rb +30 -7
- data/lib/graphql/backtrace/table.rb +21 -5
- data/lib/graphql/backtrace/traced_error.rb +8 -3
- data/lib/graphql/backtrace.rb +14 -9
- data/lib/graphql/coercion_error.rb +1 -0
- data/lib/graphql/current.rb +44 -19
- 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 +36 -22
- 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 +10 -7
- data/lib/graphql/dataloader/null_dataloader.rb +4 -3
- data/lib/graphql/dataloader/request.rb +8 -2
- data/lib/graphql/dataloader/request_all.rb +8 -2
- data/lib/graphql/dataloader/source.rb +127 -35
- data/lib/graphql/dataloader.rb +93 -42
- data/lib/graphql/date_encoding_error.rb +2 -1
- data/lib/graphql/dig.rb +12 -3
- data/lib/graphql/duration_encoding_error.rb +2 -1
- data/lib/graphql/execution/directive_checks.rb +8 -3
- data/lib/graphql/execution/errors.rb +20 -6
- data/lib/graphql/execution/field_resolve_step.rb +40 -13
- data/lib/graphql/execution/finalize.rb +12 -6
- data/lib/graphql/execution/input_values.rb +2 -1
- data/lib/graphql/execution/interpreter/argument_value.rb +17 -5
- data/lib/graphql/execution/interpreter/arguments.rb +24 -9
- data/lib/graphql/execution/interpreter/arguments_cache.rb +2 -1
- data/lib/graphql/execution/interpreter/execution_errors.rb +1 -0
- data/lib/graphql/execution/interpreter/handles_raw_value.rb +1 -0
- data/lib/graphql/execution/interpreter/resolve.rb +18 -8
- data/lib/graphql/execution/interpreter/runtime/graphql_result.rb +4 -1
- data/lib/graphql/execution/interpreter/runtime.rb +72 -25
- data/lib/graphql/execution/interpreter.rb +15 -6
- data/lib/graphql/execution/lazy/lazy_method_map.rb +21 -8
- data/lib/graphql/execution/lazy.rb +34 -10
- data/lib/graphql/execution/load_argument_step.rb +1 -0
- data/lib/graphql/execution/lookahead.rb +137 -54
- data/lib/graphql/execution/multiplex.rb +4 -4
- data/lib/graphql/execution/next.rb +7 -0
- data/lib/graphql/execution/prepare_object_step.rb +1 -0
- data/lib/graphql/execution/resolve_type_step.rb +2 -1
- data/lib/graphql/execution/runner.rb +9 -3
- data/lib/graphql/execution/selections_step.rb +3 -2
- data/lib/graphql/execution.rb +2 -2
- data/lib/graphql/execution_error.rb +19 -10
- data/lib/graphql/float_decoding_error.rb +1 -0
- data/lib/graphql/float_encoding_error.rb +7 -2
- data/lib/graphql/integer_decoding_error.rb +2 -1
- data/lib/graphql/integer_encoding_error.rb +8 -3
- data/lib/graphql/introspection/base_object.rb +3 -1
- 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 +1 -0
- 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 +19 -6
- data/lib/graphql/language/block_string.rb +2 -1
- data/lib/graphql/language/cache.rb +10 -4
- 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 +9 -10
- data/lib/graphql/language/generation.rb +23 -9
- data/lib/graphql/language/lexer.rb +5 -0
- data/lib/graphql/language/nodes.rb +2094 -419
- data/lib/graphql/language/parser.rb +24 -17
- data/lib/graphql/language/printer.rb +31 -16
- data/lib/graphql/language/sanitized_printer.rb +16 -5
- data/lib/graphql/language/static_visitor.rb +19 -4
- data/lib/graphql/language/visitor.rb +51 -29
- data/lib/graphql/language.rb +13 -7
- data/lib/graphql/load_application_object_failed_error.rb +14 -5
- data/lib/graphql/name_validator.rb +1 -0
- data/lib/graphql/pagination/active_record_relation_connection.rb +1 -0
- data/lib/graphql/pagination/array_connection.rb +20 -6
- data/lib/graphql/pagination/connection.rb +178 -48
- data/lib/graphql/pagination/connections.rb +21 -14
- data/lib/graphql/pagination/mongoid_relation_connection.rb +1 -0
- data/lib/graphql/pagination/relation_connection.rb +123 -22
- data/lib/graphql/pagination/sequel_dataset_connection.rb +1 -0
- data/lib/graphql/pagination.rb +1 -0
- data/lib/graphql/parse_error.rb +1 -0
- data/lib/graphql/query/context/scoped_context.rb +2 -1
- data/lib/graphql/query/context.rb +106 -35
- data/lib/graphql/query/fingerprint.rb +15 -7
- data/lib/graphql/query/input_validation_result.rb +1 -0
- data/lib/graphql/query/null_context.rb +1 -0
- data/lib/graphql/query/partial.rb +28 -15
- data/lib/graphql/query/result.rb +15 -5
- data/lib/graphql/query/validation_pipeline.rb +16 -6
- data/lib/graphql/query/variable_validation_error.rb +1 -0
- data/lib/graphql/query/variables.rb +9 -2
- data/lib/graphql/query.rb +193 -49
- data/lib/graphql/railtie.rb +7 -3
- data/lib/graphql/rake_task/validate.rb +72 -17
- data/lib/graphql/rake_task.rb +55 -23
- data/lib/graphql/relay/range_add.rb +32 -21
- 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 +9 -6
- data/lib/graphql/rubocop/graphql/default_required_true.rb +9 -6
- data/lib/graphql/rubocop/graphql/field_type_in_block.rb +12 -8
- data/lib/graphql/rubocop/graphql/root_types_in_block.rb +9 -5
- 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 +18 -6
- data/lib/graphql/schema/always_visible.rb +1 -0
- data/lib/graphql/schema/argument.rb +265 -42
- data/lib/graphql/schema/base_64_encoder.rb +2 -2
- data/lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb +1 -0
- data/lib/graphql/schema/build_from_definition/resolve_map.rb +2 -2
- data/lib/graphql/schema/build_from_definition.rb +94 -27
- 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 +39 -22
- data/lib/graphql/schema/directive/flagged.rb +6 -1
- data/lib/graphql/schema/directive/include.rb +1 -0
- data/lib/graphql/schema/directive/one_of.rb +1 -0
- 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 +17 -8
- data/lib/graphql/schema/directive.rb +12 -7
- data/lib/graphql/schema/enum.rb +99 -38
- data/lib/graphql/schema/enum_value.rb +21 -13
- data/lib/graphql/schema/field/connection_extension.rb +10 -2
- data/lib/graphql/schema/field/scope_extension.rb +1 -0
- data/lib/graphql/schema/field.rb +621 -109
- data/lib/graphql/schema/field_extension.rb +89 -34
- data/lib/graphql/schema/find_inherited_value.rb +5 -3
- data/lib/graphql/schema/finder.rb +22 -8
- data/lib/graphql/schema/has_single_input_argument.rb +39 -6
- data/lib/graphql/schema/input_object.rb +40 -13
- data/lib/graphql/schema/interface.rb +33 -17
- data/lib/graphql/schema/introspection_system.rb +7 -3
- data/lib/graphql/schema/late_bound_type.rb +2 -2
- data/lib/graphql/schema/list.rb +15 -4
- data/lib/graphql/schema/loader.rb +23 -12
- data/lib/graphql/schema/member/base_dsl_methods.rb +58 -12
- data/lib/graphql/schema/member/build_type.rb +16 -5
- data/lib/graphql/schema/member/graphql_type_names.rb +10 -6
- data/lib/graphql/schema/member/has_arguments.rb +115 -48
- data/lib/graphql/schema/member/has_ast_node.rb +1 -0
- data/lib/graphql/schema/member/has_authorization.rb +5 -0
- data/lib/graphql/schema/member/has_dataloader.rb +91 -34
- data/lib/graphql/schema/member/has_deprecation_reason.rb +15 -2
- data/lib/graphql/schema/member/has_directives.rb +38 -10
- data/lib/graphql/schema/member/has_fields.rb +151 -70
- data/lib/graphql/schema/member/has_interfaces.rb +10 -2
- data/lib/graphql/schema/member/has_path.rb +14 -5
- data/lib/graphql/schema/member/has_unresolved_type_error.rb +1 -0
- data/lib/graphql/schema/member/has_validators.rb +19 -4
- data/lib/graphql/schema/member/relay_shortcuts.rb +10 -2
- data/lib/graphql/schema/member/scoped.rb +14 -3
- data/lib/graphql/schema/member/type_system_helpers.rb +36 -6
- data/lib/graphql/schema/member/validates_input.rb +1 -0
- data/lib/graphql/schema/member.rb +9 -2
- data/lib/graphql/schema/mutation.rb +50 -46
- data/lib/graphql/schema/non_null.rb +21 -5
- data/lib/graphql/schema/object.rb +33 -12
- data/lib/graphql/schema/printer.rb +52 -31
- data/lib/graphql/schema/ractor_shareable.rb +6 -2
- data/lib/graphql/schema/relay_classic_mutation.rb +3 -3
- data/lib/graphql/schema/resolver/has_payload_type.rb +29 -7
- data/lib/graphql/schema/resolver.rb +156 -45
- data/lib/graphql/schema/scalar.rb +1 -0
- data/lib/graphql/schema/subscription.rb +67 -28
- data/lib/graphql/schema/timeout.rb +65 -25
- data/lib/graphql/schema/type_expression.rb +14 -5
- data/lib/graphql/schema/type_membership.rb +29 -10
- data/lib/graphql/schema/union.rb +4 -2
- data/lib/graphql/schema/unique_within_type.rb +24 -5
- data/lib/graphql/schema/validator/all_validator.rb +17 -9
- data/lib/graphql/schema/validator/allow_blank_validator.rb +8 -2
- data/lib/graphql/schema/validator/allow_null_validator.rb +8 -2
- data/lib/graphql/schema/validator/exclusion_validator.rb +14 -5
- data/lib/graphql/schema/validator/format_validator.rb +21 -10
- data/lib/graphql/schema/validator/inclusion_validator.rb +15 -6
- data/lib/graphql/schema/validator/length_validator.rb +23 -12
- data/lib/graphql/schema/validator/numericality_validator.rb +29 -16
- data/lib/graphql/schema/validator/required_validator.rb +45 -31
- data/lib/graphql/schema/validator.rb +89 -25
- data/lib/graphql/schema/visibility/migration.rb +14 -7
- data/lib/graphql/schema/visibility/profile.rb +65 -20
- data/lib/graphql/schema/visibility/visit.rb +12 -10
- data/lib/graphql/schema/visibility.rb +24 -20
- data/lib/graphql/schema/warden.rb +117 -31
- data/lib/graphql/schema/wrapper.rb +4 -1
- data/lib/graphql/schema.rb +1046 -300
- data/lib/graphql/static_validation/all_rules.rb +2 -1
- data/lib/graphql/static_validation/base_visitor.rb +59 -9
- data/lib/graphql/static_validation/definition_dependencies.rb +27 -7
- data/lib/graphql/static_validation/error.rb +3 -0
- data/lib/graphql/static_validation/interpreter_visitor.rb +1 -0
- data/lib/graphql/static_validation/literal_validator.rb +1 -0
- data/lib/graphql/static_validation/rules/argument_literals_are_compatible.rb +4 -0
- data/lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb +1 -0
- data/lib/graphql/static_validation/rules/argument_names_are_unique.rb +3 -0
- data/lib/graphql/static_validation/rules/argument_names_are_unique_error.rb +1 -0
- data/lib/graphql/static_validation/rules/arguments_are_defined.rb +3 -0
- data/lib/graphql/static_validation/rules/arguments_are_defined_error.rb +1 -0
- data/lib/graphql/static_validation/rules/directives_are_defined.rb +3 -0
- data/lib/graphql/static_validation/rules/directives_are_defined_error.rb +1 -0
- data/lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb +3 -0
- data/lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb +1 -0
- data/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb +3 -0
- data/lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb +1 -0
- data/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb +9 -1
- data/lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb +1 -0
- data/lib/graphql/static_validation/rules/fields_will_merge.rb +295 -134
- data/lib/graphql/static_validation/rules/fields_will_merge_error.rb +14 -2
- data/lib/graphql/static_validation/rules/fragment_names_are_unique.rb +3 -0
- data/lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb +1 -0
- data/lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb +3 -0
- data/lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb +1 -0
- data/lib/graphql/static_validation/rules/fragment_types_exist.rb +3 -0
- data/lib/graphql/static_validation/rules/fragment_types_exist_error.rb +1 -0
- data/lib/graphql/static_validation/rules/fragments_are_finite.rb +3 -0
- data/lib/graphql/static_validation/rules/fragments_are_finite_error.rb +1 -0
- data/lib/graphql/static_validation/rules/fragments_are_named.rb +3 -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 +3 -0
- data/lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb +1 -0
- data/lib/graphql/static_validation/rules/fragments_are_used.rb +3 -0
- data/lib/graphql/static_validation/rules/fragments_are_used_error.rb +1 -0
- data/lib/graphql/static_validation/rules/input_object_names_are_unique.rb +3 -0
- data/lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb +1 -0
- data/lib/graphql/static_validation/rules/mutation_root_exists.rb +3 -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 +3 -0
- 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 +4 -0
- data/lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb +1 -0
- data/lib/graphql/static_validation/rules/operation_names_are_valid.rb +3 -0
- data/lib/graphql/static_validation/rules/operation_names_are_valid_error.rb +1 -0
- data/lib/graphql/static_validation/rules/query_root_exists.rb +3 -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 +4 -1
- data/lib/graphql/static_validation/rules/required_arguments_are_present_error.rb +1 -0
- data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb +4 -0
- 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 +43 -5
- data/lib/graphql/static_validation/rules/subscription_root_exists_error.rb +1 -0
- data/lib/graphql/static_validation/rules/unique_directives_per_location.rb +3 -0
- data/lib/graphql/static_validation/rules/unique_directives_per_location_error.rb +1 -0
- data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb +3 -0
- data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb +1 -0
- data/lib/graphql/static_validation/rules/variable_names_are_unique.rb +3 -0
- data/lib/graphql/static_validation/rules/variable_names_are_unique_error.rb +1 -0
- data/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb +207 -51
- data/lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb +1 -0
- data/lib/graphql/static_validation/rules/variables_are_input_types.rb +3 -0
- data/lib/graphql/static_validation/rules/variables_are_input_types_error.rb +1 -0
- data/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb +6 -3
- data/lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb +1 -0
- data/lib/graphql/static_validation/validation_context.rb +3 -2
- data/lib/graphql/static_validation/validation_timeout_error.rb +1 -0
- data/lib/graphql/static_validation/validator.rb +41 -16
- 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 +85 -65
- data/lib/graphql/subscriptions/broadcast_analyzer.rb +10 -4
- data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +1 -0
- data/lib/graphql/subscriptions/event.rb +25 -6
- data/lib/graphql/subscriptions/serialize.rb +58 -19
- data/lib/graphql/subscriptions.rb +172 -46
- data/lib/graphql/testing/helpers.rb +17 -4
- data/lib/graphql/testing/mock_action_cable.rb +55 -33
- data/lib/graphql/testing.rb +1 -0
- data/lib/graphql/tracing/active_support_notifications_trace.rb +17 -9
- data/lib/graphql/tracing/active_support_notifications_tracing.rb +2 -1
- data/lib/graphql/tracing/appoptics_trace.rb +2 -1
- data/lib/graphql/tracing/appoptics_tracing.rb +2 -1
- data/lib/graphql/tracing/appsignal_trace.rb +16 -7
- data/lib/graphql/tracing/appsignal_tracing.rb +7 -3
- data/lib/graphql/tracing/call_legacy_tracers.rb +1 -0
- data/lib/graphql/tracing/data_dog_trace.rb +17 -6
- data/lib/graphql/tracing/data_dog_tracing.rb +10 -3
- 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 +105 -42
- data/lib/graphql/tracing/legacy_hooks_trace.rb +5 -0
- data/lib/graphql/tracing/legacy_trace.rb +1 -0
- data/lib/graphql/tracing/monitor_trace.rb +17 -11
- data/lib/graphql/tracing/new_relic_trace.rb +17 -8
- data/lib/graphql/tracing/new_relic_tracing.rb +7 -3
- data/lib/graphql/tracing/notifications_trace.rb +11 -8
- data/lib/graphql/tracing/notifications_tracing.rb +23 -7
- 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 +41 -19
- data/lib/graphql/tracing/platform_trace.rb +3 -1
- data/lib/graphql/tracing/platform_tracing.rb +16 -7
- data/lib/graphql/tracing/prometheus_trace/graphql_collector.rb +1 -0
- data/lib/graphql/tracing/prometheus_trace.rb +22 -13
- data/lib/graphql/tracing/prometheus_tracing.rb +1 -0
- data/lib/graphql/tracing/scout_trace.rb +10 -4
- data/lib/graphql/tracing/scout_tracing.rb +7 -3
- data/lib/graphql/tracing/sentry_trace.rb +12 -5
- data/lib/graphql/tracing/statsd_trace.rb +12 -6
- data/lib/graphql/tracing/statsd_tracing.rb +7 -1
- data/lib/graphql/tracing/trace.rb +231 -58
- data/lib/graphql/tracing.rb +25 -9
- data/lib/graphql/type_kinds.rb +2 -1
- data/lib/graphql/types/big_int.rb +1 -0
- data/lib/graphql/types/boolean.rb +1 -0
- data/lib/graphql/types/float.rb +1 -0
- data/lib/graphql/types/id.rb +1 -0
- data/lib/graphql/types/int.rb +2 -1
- data/lib/graphql/types/iso_8601_date.rb +21 -4
- data/lib/graphql/types/iso_8601_date_time.rb +33 -6
- data/lib/graphql/types/iso_8601_duration.rb +42 -9
- data/lib/graphql/types/json.rb +1 -0
- data/lib/graphql/types/relay/base_connection.rb +38 -32
- data/lib/graphql/types/relay/base_edge.rb +15 -9
- data/lib/graphql/types/relay/connection_behaviors.rb +19 -3
- data/lib/graphql/types/relay/edge_behaviors.rb +17 -4
- data/lib/graphql/types/relay/has_node_field.rb +6 -1
- data/lib/graphql/types/relay/has_nodes_field.rb +6 -1
- data/lib/graphql/types/relay/node.rb +1 -0
- data/lib/graphql/types/relay/node_behaviors.rb +5 -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 +4 -3
- data/lib/graphql/types/string.rb +1 -0
- data/lib/graphql/types.rb +1 -0
- data/lib/graphql/unauthorized_enum_value_error.rb +4 -1
- data/lib/graphql/unauthorized_error.rb +11 -4
- data/lib/graphql/unauthorized_field_error.rb +4 -1
- data/lib/graphql/unresolved_type_error.rb +16 -5
- data/lib/graphql/version.rb +2 -1
- data/lib/graphql.rb +37 -9
- data/readme.md +1 -1
- metadata +89 -5
- data/.yardopts +0 -5
|
@@ -1,6 +1,178 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
# typed: true
|
|
2
3
|
module GraphQL
|
|
3
4
|
class Schema
|
|
5
|
+
# Arguments describe the input accepted by a field or input object.
|
|
6
|
+
# Keep argument-specific behavior and examples here; the guide is only
|
|
7
|
+
# an entry point for the broader fields documentation.
|
|
8
|
+
#
|
|
9
|
+
# Fields can take **arguments** as input. These can be used to determine the return value (eg, filtering search results) or to modify the application state (eg, updating the database in `MutationType`).
|
|
10
|
+
#
|
|
11
|
+
# Arguments are defined with the `argument` helper. These arguments are passed as [keyword arguments](https://robots.thoughtbot.com/ruby-2-keyword-arguments) to the resolver method:
|
|
12
|
+
#
|
|
13
|
+
# ```ruby
|
|
14
|
+
# field :search_posts, [PostType], null: false do
|
|
15
|
+
# argument :category, String
|
|
16
|
+
# end
|
|
17
|
+
#
|
|
18
|
+
# def search_posts(category:)
|
|
19
|
+
# Post.where(category: category).limit(10)
|
|
20
|
+
# end
|
|
21
|
+
# ```
|
|
22
|
+
#
|
|
23
|
+
# ## Nullability
|
|
24
|
+
#
|
|
25
|
+
# To make an argument optional, set `required: false`, and set default values for the corresponding keyword arguments:
|
|
26
|
+
#
|
|
27
|
+
# ```ruby
|
|
28
|
+
# field :search_posts, [PostType], null: false do
|
|
29
|
+
# argument :category, String, required: false
|
|
30
|
+
# end
|
|
31
|
+
#
|
|
32
|
+
# def search_posts(category: nil)
|
|
33
|
+
# if category
|
|
34
|
+
# Post.where(category: category).limit(10)
|
|
35
|
+
# else
|
|
36
|
+
# Post.all.limit(10)
|
|
37
|
+
# end
|
|
38
|
+
# end
|
|
39
|
+
# ```
|
|
40
|
+
#
|
|
41
|
+
# Be aware that if all arguments are optional and the query does not provide any arguments, then the resolver method will be called with no arguments. To prevent an `ArgumentError` in this case, you must either specify default values for all keyword arguments (as done in the prior example) or use the double splat operator argument in the method definition. For example:
|
|
42
|
+
#
|
|
43
|
+
# ```ruby
|
|
44
|
+
# def search_posts(**args)
|
|
45
|
+
# if args[:category]
|
|
46
|
+
# Post.where(category: args[:category]).limit(10)
|
|
47
|
+
# else
|
|
48
|
+
# Post.all.limit(10)
|
|
49
|
+
# end
|
|
50
|
+
# end
|
|
51
|
+
# ```
|
|
52
|
+
#
|
|
53
|
+
# ### Default Values
|
|
54
|
+
#
|
|
55
|
+
# Another approach is to use `default_value: value` to provide a default value for the argument if it is not supplied in the query.
|
|
56
|
+
#
|
|
57
|
+
# ```ruby
|
|
58
|
+
# field :search_posts, [PostType], null: false do
|
|
59
|
+
# argument :category, String, required: false, default_value: "Programming"
|
|
60
|
+
# end
|
|
61
|
+
#
|
|
62
|
+
# def search_posts(category:)
|
|
63
|
+
# Post.where(category: category).limit(10)
|
|
64
|
+
# end
|
|
65
|
+
# ```
|
|
66
|
+
#
|
|
67
|
+
# Arguments with `required: false` _do_ accept `null` as inputs from clients. This can be surprising in resolver code, for example, an argument with `Integer, required: false` can sometimes be `nil`. In this case, you can use `replace_null_with_default: true` to apply the given `default_value: ...` when clients provide `null`. For example:
|
|
68
|
+
#
|
|
69
|
+
# ```ruby
|
|
70
|
+
# # Even if clients send `query: null`, the resolver will receive `"*"` for this argument:
|
|
71
|
+
# argument :query, String, required: false, default_value: "*", replace_null_with_default: true
|
|
72
|
+
# ```
|
|
73
|
+
#
|
|
74
|
+
# Finally, `required: :nullable` will require clients to pass the argument, although it will accept `null` as a valid input. For example:
|
|
75
|
+
#
|
|
76
|
+
# ```ruby
|
|
77
|
+
# # This argument _must_ be given -- send `null` if there's no other appropriate value:
|
|
78
|
+
# argument :email_address, String, required: :nullable
|
|
79
|
+
# ```
|
|
80
|
+
#
|
|
81
|
+
#
|
|
82
|
+
# ## Deprecation
|
|
83
|
+
#
|
|
84
|
+
# **Experimental:** __Deprecated__ arguments can be marked by adding a `deprecation_reason:` keyword argument:
|
|
85
|
+
#
|
|
86
|
+
# ```ruby
|
|
87
|
+
# field :search_posts, [PostType], null: false do
|
|
88
|
+
# argument :name, String, required: false, deprecation_reason: "Use `query` instead."
|
|
89
|
+
# argument :query, String, required: false
|
|
90
|
+
# end
|
|
91
|
+
# ```
|
|
92
|
+
#
|
|
93
|
+
# ## Aliasing
|
|
94
|
+
#
|
|
95
|
+
# Use `as: :alternate_name` to use a different key from within your resolvers while
|
|
96
|
+
# exposing another key to clients.
|
|
97
|
+
#
|
|
98
|
+
# ```ruby
|
|
99
|
+
# field :post, PostType, null: false do
|
|
100
|
+
# argument :post_id, ID, as: :id
|
|
101
|
+
# end
|
|
102
|
+
#
|
|
103
|
+
# def post(id:)
|
|
104
|
+
# Post.find(id)
|
|
105
|
+
# end
|
|
106
|
+
# ```
|
|
107
|
+
#
|
|
108
|
+
# ## Preprocessing
|
|
109
|
+
#
|
|
110
|
+
# Provide a `prepare` function to modify or validate the value of an argument before the field's resolver method is executed:
|
|
111
|
+
#
|
|
112
|
+
# ```ruby
|
|
113
|
+
# field :posts, [PostType], null: false do
|
|
114
|
+
# argument :start_date, String, prepare: ->(startDate, ctx) {
|
|
115
|
+
# # return the prepared argument.
|
|
116
|
+
# # raise a GraphQL::ExecutionError to halt the execution of the field and
|
|
117
|
+
# # add the exception's message to the `errors` key.
|
|
118
|
+
# }
|
|
119
|
+
# end
|
|
120
|
+
#
|
|
121
|
+
# def posts(start_date:)
|
|
122
|
+
# # use prepared start_date
|
|
123
|
+
# end
|
|
124
|
+
# ```
|
|
125
|
+
#
|
|
126
|
+
# ## Automatic camelization
|
|
127
|
+
#
|
|
128
|
+
# Arguments that are snake_cased will be camelized in the GraphQL schema. Using the example of:
|
|
129
|
+
#
|
|
130
|
+
# ```ruby
|
|
131
|
+
# field :posts, [PostType], null: false do
|
|
132
|
+
# argument :start_year, Int
|
|
133
|
+
# end
|
|
134
|
+
# ```
|
|
135
|
+
#
|
|
136
|
+
# The corresponding GraphQL query will look like:
|
|
137
|
+
#
|
|
138
|
+
# ```graphql
|
|
139
|
+
# {
|
|
140
|
+
# posts(startYear: 2018) {
|
|
141
|
+
# id
|
|
142
|
+
# }
|
|
143
|
+
# }
|
|
144
|
+
# ```
|
|
145
|
+
#
|
|
146
|
+
# To disable auto-camelization, pass `camelize: false` to the `argument` method.
|
|
147
|
+
#
|
|
148
|
+
# ```ruby
|
|
149
|
+
# field :posts, [PostType], null: false do
|
|
150
|
+
# argument :start_year, Int, camelize: false
|
|
151
|
+
# end
|
|
152
|
+
# ```
|
|
153
|
+
#
|
|
154
|
+
# Furthermore, if your argument is already camelCased, then it will remain camelized in the GraphQL schema. However, the argument will be converted to snake_case when it is passed to the resolver method:
|
|
155
|
+
#
|
|
156
|
+
# ```ruby
|
|
157
|
+
# field :posts, [PostType], null: false do
|
|
158
|
+
# argument :startYear, Int
|
|
159
|
+
# end
|
|
160
|
+
#
|
|
161
|
+
# def posts(start_year:)
|
|
162
|
+
# # ...
|
|
163
|
+
# end
|
|
164
|
+
# ```
|
|
165
|
+
#
|
|
166
|
+
# ## Valid Argument Types
|
|
167
|
+
#
|
|
168
|
+
# Only certain types are valid for arguments:
|
|
169
|
+
#
|
|
170
|
+
# - [GraphQL::Schema::Scalar](rdoc-ref:GraphQL::Schema::Scalar), including built-in scalars (string, int, float, boolean, ID)
|
|
171
|
+
# - [GraphQL::Schema::Enum](rdoc-ref:GraphQL::Schema::Enum)
|
|
172
|
+
# - [GraphQL::Schema::InputObject](rdoc-ref:GraphQL::Schema::InputObject), which allows key-value pairs as input
|
|
173
|
+
# - [GraphQL::Schema::List](rdoc-ref:GraphQL::Schema::List)s of a valid input type, configured using `[...]`
|
|
174
|
+
# - [GraphQL::Schema::NonNull](rdoc-ref:GraphQL::Schema::NonNull)s of a valid input type (arguments are non-null by default; use `required: false` to make optional arguments)
|
|
175
|
+
#
|
|
4
176
|
class Argument
|
|
5
177
|
include GraphQL::Schema::Member::HasPath
|
|
6
178
|
include GraphQL::Schema::Member::HasAstNode
|
|
@@ -10,15 +182,27 @@ module GraphQL
|
|
|
10
182
|
include GraphQL::Schema::Member::HasValidators
|
|
11
183
|
include GraphQL::EmptyObjects
|
|
12
184
|
|
|
13
|
-
#
|
|
185
|
+
# **Returns**
|
|
186
|
+
#
|
|
187
|
+
# - `String` — the GraphQL name for this argument, camelized unless `camelize: false` is provided
|
|
14
188
|
attr_reader :name
|
|
15
189
|
alias :graphql_name :name
|
|
16
190
|
|
|
17
|
-
#
|
|
191
|
+
# **Returns**
|
|
192
|
+
#
|
|
193
|
+
# - `GraphQL::Schema::Field, Class` — The field or input object this argument belongs to
|
|
18
194
|
attr_reader :owner
|
|
19
195
|
|
|
20
|
-
#
|
|
21
|
-
#
|
|
196
|
+
# **Parameters**
|
|
197
|
+
#
|
|
198
|
+
# - `new_prepare` (`Method, Proc`)
|
|
199
|
+
#
|
|
200
|
+
# **Returns**
|
|
201
|
+
#
|
|
202
|
+
# - `Symbol` — A method or proc to call to transform this value before sending it to field resolution method
|
|
203
|
+
#
|
|
204
|
+
# :call-seq:
|
|
205
|
+
# prepare(Method | Proc new_prepare) -> Symbol
|
|
22
206
|
def prepare(new_prepare = NOT_CONFIGURED)
|
|
23
207
|
if new_prepare != NOT_CONFIGURED
|
|
24
208
|
@prepare = new_prepare
|
|
@@ -26,38 +210,52 @@ module GraphQL
|
|
|
26
210
|
@prepare
|
|
27
211
|
end
|
|
28
212
|
|
|
29
|
-
#
|
|
213
|
+
# **Returns**
|
|
214
|
+
#
|
|
215
|
+
# - `Symbol` — This argument's name in Ruby keyword arguments
|
|
30
216
|
attr_reader :keyword
|
|
31
217
|
|
|
32
|
-
#
|
|
218
|
+
# **Returns**
|
|
219
|
+
#
|
|
220
|
+
# - `Class, Module, nil` — If this argument should load an application object, this is the type of object to load
|
|
33
221
|
attr_reader :loads
|
|
34
222
|
|
|
35
|
-
#
|
|
223
|
+
# **Returns**
|
|
224
|
+
#
|
|
225
|
+
# - `Boolean` — true if a resolver defined this argument
|
|
226
|
+
#
|
|
227
|
+
# :call-seq:
|
|
228
|
+
# from_resolver?() -> bool
|
|
36
229
|
def from_resolver?
|
|
37
230
|
@from_resolver
|
|
38
231
|
end
|
|
39
232
|
|
|
40
|
-
#
|
|
41
|
-
#
|
|
42
|
-
#
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
#
|
|
46
|
-
#
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
54
|
-
#
|
|
55
|
-
#
|
|
56
|
-
#
|
|
57
|
-
#
|
|
58
|
-
#
|
|
59
|
-
#
|
|
60
|
-
#
|
|
233
|
+
# **Parameters**
|
|
234
|
+
#
|
|
235
|
+
# - `arg_name` (`Symbol`)
|
|
236
|
+
# - `type_expr`
|
|
237
|
+
# - `desc` (`String`)
|
|
238
|
+
# - `type` (`Class, Array<Class>`) — Input type; positional argument also accepted
|
|
239
|
+
# - `name` (`Symbol`) — positional argument also accepted
|
|
240
|
+
# - `definition_block` (`Proc`) — Called with the newly-created [Argument](rdoc-ref:Argument)
|
|
241
|
+
# - `owner` (`Class`) — Private, used by GraphQL-Ruby during schema definition
|
|
242
|
+
# - `required` (`Boolean, :nullable`) — if true, this argument is non-null; if false, this argument is nullable. If `:nullable`, then the argument must be provided, though it may be `null`.
|
|
243
|
+
# - `description` (`String`)
|
|
244
|
+
# - `default_value` (`Object`)
|
|
245
|
+
# - `loads` (`Class, Array<Class>`) — A GraphQL type to load for the given ID when one is present
|
|
246
|
+
# - `as` (`Symbol`) — Override the keyword name when passed to a method
|
|
247
|
+
# - `prepare` (`Symbol`) — A method to call to transform this argument's valuebefore sending it to field resolution
|
|
248
|
+
# - `camelize` (`Boolean`) — if true, the name will be camelized when building the schema
|
|
249
|
+
# - `from_resolver` (`Boolean`) — if true, a Resolver class defined this argument
|
|
250
|
+
# - `directives` (`Hash{Class => Hash}`)
|
|
251
|
+
# - `deprecation_reason` (`String`)
|
|
252
|
+
# - `validates` (`Hash, nil`) — Options for building validators, if any should be applied
|
|
253
|
+
# - `replace_null_with_default` (`Boolean`) — if `true`, incoming values of `null` will be replaced with the configured `default_value`
|
|
254
|
+
# - `comment` (`String`) — Private, used by GraphQL-Ruby when parsing GraphQL schema files
|
|
255
|
+
# - `ast_node` (`GraphQL::Language::Nodes::InputValueDefinition`) — Private, used by GraphQL-Ruby when parsing schema files
|
|
256
|
+
#
|
|
257
|
+
# :call-seq:
|
|
258
|
+
# initialize(Symbol arg_name, type_expr, String desc, bool | :nullable required:, Class | Array[Class] type:, Symbol name:, Class | Array[Class] loads:, String description:, String comment:, GraphQL::Language::Nodes::InputValueDefinition ast_node:, Object default_value:, Symbol as:, bool from_resolver:, bool camelize:, Symbol prepare:, Class owner:, Hash | nil validates:, Hash[Class, Hash] directives:, String deprecation_reason:, bool replace_null_with_default:, Proc &definition_block)
|
|
61
259
|
def initialize(arg_name = nil, type_expr = nil, desc = nil, required: true, type: nil, name: nil, loads: nil, description: nil, comment: nil, ast_node: nil, default_value: NOT_CONFIGURED, as: nil, from_resolver: false, camelize: true, prepare: nil, owner:, validates: nil, directives: nil, deprecation_reason: nil, replace_null_with_default: false, &definition_block)
|
|
62
260
|
arg_name ||= name
|
|
63
261
|
@name = -(camelize ? Member::BuildType.camelize(arg_name.to_s) : arg_name.to_s)
|
|
@@ -107,8 +305,16 @@ module GraphQL
|
|
|
107
305
|
"#<#{self.class} #{path}: #{type.to_type_signature}#{description ? " @description=#{description.inspect}" : ""}>"
|
|
108
306
|
end
|
|
109
307
|
|
|
110
|
-
#
|
|
111
|
-
#
|
|
308
|
+
# **Parameters**
|
|
309
|
+
#
|
|
310
|
+
# - `default_value` (`Object`) — The value to use when the client doesn't provide one
|
|
311
|
+
#
|
|
312
|
+
# **Returns**
|
|
313
|
+
#
|
|
314
|
+
# - `Object` — the value used when the client doesn't provide a value for this argument
|
|
315
|
+
#
|
|
316
|
+
# :call-seq:
|
|
317
|
+
# default_value(new_default_value) -> Object
|
|
112
318
|
def default_value(new_default_value = NOT_CONFIGURED)
|
|
113
319
|
if new_default_value != NOT_CONFIGURED
|
|
114
320
|
@default_value = new_default_value
|
|
@@ -116,7 +322,12 @@ module GraphQL
|
|
|
116
322
|
@default_value
|
|
117
323
|
end
|
|
118
324
|
|
|
119
|
-
#
|
|
325
|
+
# **Returns**
|
|
326
|
+
#
|
|
327
|
+
# - `Boolean` — True if this argument has a default value
|
|
328
|
+
#
|
|
329
|
+
# :call-seq:
|
|
330
|
+
# default_value?() -> bool
|
|
120
331
|
def default_value?
|
|
121
332
|
@default_value != NOT_CONFIGURED
|
|
122
333
|
end
|
|
@@ -127,7 +338,12 @@ module GraphQL
|
|
|
127
338
|
|
|
128
339
|
attr_writer :description
|
|
129
340
|
|
|
130
|
-
#
|
|
341
|
+
# **Returns**
|
|
342
|
+
#
|
|
343
|
+
# - `String` — Documentation for this argument
|
|
344
|
+
#
|
|
345
|
+
# :call-seq:
|
|
346
|
+
# description(text) -> String
|
|
131
347
|
def description(text = nil)
|
|
132
348
|
if text
|
|
133
349
|
@description = text
|
|
@@ -138,7 +354,12 @@ module GraphQL
|
|
|
138
354
|
|
|
139
355
|
attr_writer :comment
|
|
140
356
|
|
|
141
|
-
#
|
|
357
|
+
# **Returns**
|
|
358
|
+
#
|
|
359
|
+
# - `String` — Comment for this argument
|
|
360
|
+
#
|
|
361
|
+
# :call-seq:
|
|
362
|
+
# comment(text) -> String
|
|
142
363
|
def comment(text = nil)
|
|
143
364
|
if text
|
|
144
365
|
@comment = text
|
|
@@ -147,7 +368,12 @@ module GraphQL
|
|
|
147
368
|
end
|
|
148
369
|
end
|
|
149
370
|
|
|
150
|
-
#
|
|
371
|
+
# **Returns**
|
|
372
|
+
#
|
|
373
|
+
# - `String` — Deprecation reason for this argument
|
|
374
|
+
#
|
|
375
|
+
# :call-seq:
|
|
376
|
+
# deprecation_reason(text) -> String
|
|
151
377
|
def deprecation_reason(text = nil)
|
|
152
378
|
if text
|
|
153
379
|
self.deprecation_reason = text
|
|
@@ -229,10 +455,9 @@ module GraphQL
|
|
|
229
455
|
super
|
|
230
456
|
end
|
|
231
457
|
|
|
232
|
-
# Apply the
|
|
458
|
+
# Apply the [prepare](rdoc-ref:prepare) configuration to `value`, using methods from `obj`.
|
|
233
459
|
# Used by the runtime.
|
|
234
|
-
#
|
|
235
|
-
def prepare_value(obj, value, context: nil)
|
|
460
|
+
def prepare_value(obj, value, context: nil) # :nodoc:
|
|
236
461
|
if type.unwrap.kind.input_object?
|
|
237
462
|
value = recursively_prepare_input_object(value, type, context)
|
|
238
463
|
end
|
|
@@ -263,8 +488,7 @@ module GraphQL
|
|
|
263
488
|
end
|
|
264
489
|
end
|
|
265
490
|
|
|
266
|
-
#
|
|
267
|
-
def coerce_into_values(parent_object, values, context, argument_values)
|
|
491
|
+
def coerce_into_values(parent_object, values, context, argument_values) # :nodoc:
|
|
268
492
|
arg_name = graphql_name
|
|
269
493
|
arg_key = keyword
|
|
270
494
|
default_used = false
|
|
@@ -287,7 +511,7 @@ module GraphQL
|
|
|
287
511
|
default_used = true
|
|
288
512
|
end
|
|
289
513
|
|
|
290
|
-
loaded_value = nil
|
|
514
|
+
loaded_value = nil #: untyped
|
|
291
515
|
coerced_value = begin
|
|
292
516
|
type.coerce_input(value, context)
|
|
293
517
|
rescue StandardError => err
|
|
@@ -377,8 +601,7 @@ module GraphQL
|
|
|
377
601
|
end
|
|
378
602
|
end
|
|
379
603
|
|
|
380
|
-
#
|
|
381
|
-
def validate_default_value
|
|
604
|
+
def validate_default_value # :nodoc:
|
|
382
605
|
return unless default_value?
|
|
383
606
|
coerced_default_value = begin
|
|
384
607
|
# This is weird, but we should accept single-item default values for list-type arguments.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
# typed: true
|
|
2
3
|
require "base64"
|
|
3
4
|
module GraphQL
|
|
4
5
|
class Schema
|
|
5
|
-
#
|
|
6
|
-
module Base64Encoder
|
|
6
|
+
module Base64Encoder # :nodoc:
|
|
7
7
|
def self.encode(unencoded_text, nonce: false)
|
|
8
8
|
Base64.urlsafe_encode64(unencoded_text, padding: false)
|
|
9
9
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
# typed: true
|
|
2
3
|
require "graphql/schema/build_from_definition/resolve_map/default_resolve"
|
|
3
4
|
|
|
4
5
|
module GraphQL
|
|
@@ -12,8 +13,7 @@ module GraphQL
|
|
|
12
13
|
#
|
|
13
14
|
# Interface/union resolution can be provided as a `resolve_type:` key.
|
|
14
15
|
#
|
|
15
|
-
#
|
|
16
|
-
class ResolveMap
|
|
16
|
+
class ResolveMap # :nodoc:
|
|
17
17
|
module NullScalarCoerce
|
|
18
18
|
def self.call(val, _ctx)
|
|
19
19
|
val
|