graphql 2.6.15 → 2.6.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/generators/graphql/core.rb +1 -0
- data/lib/generators/graphql/detailed_trace_generator.rb +1 -0
- data/lib/generators/graphql/enum_generator.rb +1 -0
- data/lib/generators/graphql/field_extractor.rb +1 -0
- data/lib/generators/graphql/input_generator.rb +1 -0
- data/lib/generators/graphql/install/mutation_root_generator.rb +1 -0
- data/lib/generators/graphql/install_generator.rb +1 -0
- data/lib/generators/graphql/interface_generator.rb +1 -0
- data/lib/generators/graphql/loader_generator.rb +1 -0
- data/lib/generators/graphql/mutation_create_generator.rb +1 -0
- data/lib/generators/graphql/mutation_delete_generator.rb +1 -0
- data/lib/generators/graphql/mutation_generator.rb +1 -0
- data/lib/generators/graphql/mutation_update_generator.rb +1 -0
- data/lib/generators/graphql/object_generator.rb +1 -0
- data/lib/generators/graphql/orm_mutations_base.rb +1 -0
- data/lib/generators/graphql/relay.rb +1 -0
- data/lib/generators/graphql/relay_generator.rb +1 -0
- data/lib/generators/graphql/scalar_generator.rb +1 -0
- data/lib/generators/graphql/type_generator.rb +1 -0
- data/lib/generators/graphql/union_generator.rb +1 -0
- data/lib/graphql/analysis/analyzer.rb +1 -0
- data/lib/graphql/analysis/field_usage.rb +1 -0
- data/lib/graphql/analysis/max_query_complexity.rb +1 -0
- data/lib/graphql/analysis/max_query_depth.rb +1 -0
- data/lib/graphql/analysis/query_complexity.rb +5 -1
- data/lib/graphql/analysis/query_depth.rb +1 -0
- data/lib/graphql/analysis/visitor.rb +1 -0
- data/lib/graphql/analysis.rb +1 -0
- data/lib/graphql/analysis_error.rb +1 -0
- data/lib/graphql/autoload.rb +1 -0
- data/lib/graphql/backtrace/table.rb +1 -0
- data/lib/graphql/backtrace/traced_error.rb +1 -0
- data/lib/graphql/backtrace.rb +1 -0
- data/lib/graphql/coercion_error.rb +1 -0
- data/lib/graphql/current.rb +1 -0
- data/lib/graphql/dashboard/application_controller.rb +1 -0
- data/lib/graphql/dashboard/detailed_traces.rb +1 -0
- data/lib/graphql/dashboard/installable.rb +1 -0
- data/lib/graphql/dashboard/landings_controller.rb +1 -0
- data/lib/graphql/dashboard/limiters.rb +1 -0
- data/lib/graphql/dashboard/operation_store.rb +1 -0
- data/lib/graphql/dashboard/statics_controller.rb +1 -0
- data/lib/graphql/dashboard/subscriptions.rb +1 -0
- data/lib/graphql/dashboard.rb +1 -0
- data/lib/graphql/dataloader/active_record_association_source.rb +1 -0
- data/lib/graphql/dataloader/active_record_source.rb +1 -0
- data/lib/graphql/dataloader/async_dataloader.rb +1 -0
- data/lib/graphql/dataloader/null_dataloader.rb +1 -0
- data/lib/graphql/dataloader/request.rb +1 -0
- data/lib/graphql/dataloader/request_all.rb +1 -0
- data/lib/graphql/dataloader/source.rb +1 -0
- data/lib/graphql/dataloader.rb +1 -0
- data/lib/graphql/date_encoding_error.rb +1 -0
- data/lib/graphql/dig.rb +1 -0
- data/lib/graphql/duration_encoding_error.rb +1 -0
- data/lib/graphql/execution/directive_checks.rb +1 -0
- data/lib/graphql/execution/errors.rb +1 -0
- data/lib/graphql/execution/field_resolve_step.rb +1 -0
- data/lib/graphql/execution/finalize.rb +1 -0
- data/lib/graphql/execution/input_values.rb +42 -6
- data/lib/graphql/execution/interpreter/argument_value.rb +1 -0
- data/lib/graphql/execution/interpreter/arguments.rb +1 -0
- data/lib/graphql/execution/interpreter/arguments_cache.rb +1 -0
- data/lib/graphql/execution/interpreter/execution_errors.rb +7 -4
- data/lib/graphql/execution/interpreter/handles_raw_value.rb +6 -2
- data/lib/graphql/execution/interpreter/resolve.rb +6 -2
- data/lib/graphql/execution/interpreter/runtime/graphql_result.rb +1 -0
- data/lib/graphql/execution/interpreter/runtime.rb +5 -3
- data/lib/graphql/execution/interpreter.rb +7 -4
- data/lib/graphql/execution/lazy/lazy_method_map.rb +1 -0
- data/lib/graphql/execution/lazy.rb +1 -0
- data/lib/graphql/execution/load_argument_step.rb +1 -0
- data/lib/graphql/execution/lookahead.rb +2 -0
- data/lib/graphql/execution/multiplex.rb +1 -0
- data/lib/graphql/execution/next.rb +1 -0
- data/lib/graphql/execution/prepare_object_step.rb +3 -5
- data/lib/graphql/execution/resolve_type_step.rb +1 -0
- data/lib/graphql/execution/runner.rb +2 -0
- data/lib/graphql/execution/selections_step.rb +1 -0
- data/lib/graphql/execution/variable_values.rb +20 -6
- data/lib/graphql/execution.rb +1 -0
- data/lib/graphql/execution_error.rb +1 -0
- data/lib/graphql/float_decoding_error.rb +1 -0
- data/lib/graphql/float_encoding_error.rb +1 -0
- data/lib/graphql/integer_decoding_error.rb +1 -0
- data/lib/graphql/integer_encoding_error.rb +1 -0
- data/lib/graphql/introspection/base_object.rb +1 -0
- data/lib/graphql/introspection/directive_location_enum.rb +1 -0
- data/lib/graphql/introspection/directive_type.rb +1 -0
- data/lib/graphql/introspection/dynamic_fields.rb +1 -0
- data/lib/graphql/introspection/entry_points.rb +1 -0
- data/lib/graphql/introspection/enum_value_type.rb +1 -0
- data/lib/graphql/introspection/field_type.rb +1 -0
- data/lib/graphql/introspection/input_value_type.rb +1 -0
- data/lib/graphql/introspection/introspection_query.rb +10 -7
- data/lib/graphql/introspection/schema_type.rb +1 -0
- data/lib/graphql/introspection/type_kind_enum.rb +1 -0
- data/lib/graphql/introspection/type_type.rb +1 -0
- data/lib/graphql/introspection.rb +1 -0
- data/lib/graphql/invalid_name_error.rb +1 -0
- data/lib/graphql/invalid_null_error.rb +1 -0
- data/lib/graphql/language/block_string.rb +12 -5
- data/lib/graphql/language/cache.rb +1 -0
- data/lib/graphql/language/comment.rb +1 -0
- data/lib/graphql/language/definition_slice.rb +1 -0
- data/lib/graphql/language/document_from_schema_definition.rb +1 -0
- data/lib/graphql/language/generation.rb +1 -0
- data/lib/graphql/language/lexer.rb +4 -4
- data/lib/graphql/language/nodes.rb +1 -0
- data/lib/graphql/language/parser.rb +1 -0
- data/lib/graphql/language/printer.rb +1 -0
- data/lib/graphql/language/sanitized_printer.rb +1 -0
- data/lib/graphql/language/static_visitor.rb +1 -0
- data/lib/graphql/language/visitor.rb +1 -0
- data/lib/graphql/language.rb +1 -0
- data/lib/graphql/load_application_object_failed_error.rb +1 -0
- data/lib/graphql/name_validator.rb +1 -0
- data/lib/graphql/pagination/active_record_relation_connection.rb +9 -1
- data/lib/graphql/pagination/array_connection.rb +1 -0
- data/lib/graphql/pagination/connection.rb +1 -0
- data/lib/graphql/pagination/connections.rb +1 -0
- data/lib/graphql/pagination/mongoid_relation_connection.rb +6 -1
- data/lib/graphql/pagination/relation_connection.rb +5 -4
- data/lib/graphql/pagination/sequel_dataset_connection.rb +6 -1
- data/lib/graphql/pagination.rb +1 -0
- data/lib/graphql/parse_error.rb +1 -0
- data/lib/graphql/query/context/scoped_context.rb +1 -0
- data/lib/graphql/query/context.rb +1 -0
- data/lib/graphql/query/fingerprint.rb +1 -0
- data/lib/graphql/query/input_validation_result.rb +44 -0
- data/lib/graphql/query/null_context.rb +1 -0
- data/lib/graphql/query/partial.rb +1 -0
- data/lib/graphql/query/result.rb +1 -0
- data/lib/graphql/query/validation_pipeline.rb +1 -0
- data/lib/graphql/query/variable_validation_error.rb +1 -0
- data/lib/graphql/query.rb +1 -0
- data/lib/graphql/railtie.rb +1 -0
- data/lib/graphql/rake_task/validate.rb +1 -0
- data/lib/graphql/rake_task.rb +1 -0
- data/lib/graphql/relay/range_add.rb +1 -0
- data/lib/graphql/relay.rb +1 -0
- data/lib/graphql/rubocop/graphql/base_cop.rb +1 -0
- data/lib/graphql/rubocop/graphql/default_null_true.rb +1 -0
- data/lib/graphql/rubocop/graphql/default_required_true.rb +1 -0
- data/lib/graphql/rubocop/graphql/field_type_in_block.rb +1 -0
- data/lib/graphql/rubocop/graphql/root_types_in_block.rb +1 -0
- data/lib/graphql/rubocop.rb +1 -0
- data/lib/graphql/runtime_error.rb +1 -0
- data/lib/graphql/runtime_type_error.rb +1 -0
- data/lib/graphql/schema/addition.rb +1 -0
- data/lib/graphql/schema/always_visible.rb +1 -0
- data/lib/graphql/schema/argument.rb +1 -0
- data/lib/graphql/schema/base_64_encoder.rb +1 -0
- data/lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb +6 -3
- data/lib/graphql/schema/build_from_definition/resolve_map.rb +1 -0
- data/lib/graphql/schema/build_from_definition.rb +1 -0
- data/lib/graphql/schema/built_in_types.rb +1 -0
- data/lib/graphql/schema/directive/deprecated.rb +1 -0
- data/lib/graphql/schema/directive/feature.rb +1 -0
- data/lib/graphql/schema/directive/flagged.rb +5 -1
- data/lib/graphql/schema/directive/include.rb +1 -0
- data/lib/graphql/schema/directive/one_of.rb +5 -2
- data/lib/graphql/schema/directive/skip.rb +1 -0
- data/lib/graphql/schema/directive/specified_by.rb +1 -0
- data/lib/graphql/schema/directive/transform.rb +9 -4
- data/lib/graphql/schema/directive.rb +1 -0
- data/lib/graphql/schema/enum.rb +1 -0
- data/lib/graphql/schema/enum_value.rb +1 -0
- data/lib/graphql/schema/field/connection_extension.rb +6 -2
- data/lib/graphql/schema/field/scope_extension.rb +1 -0
- data/lib/graphql/schema/field.rb +1 -0
- data/lib/graphql/schema/field_extension.rb +1 -0
- data/lib/graphql/schema/find_inherited_value.rb +1 -0
- data/lib/graphql/schema/finder.rb +1 -0
- data/lib/graphql/schema/has_single_input_argument.rb +1 -0
- data/lib/graphql/schema/input_object.rb +1 -0
- data/lib/graphql/schema/interface.rb +1 -0
- data/lib/graphql/schema/introspection_system.rb +1 -0
- data/lib/graphql/schema/late_bound_type.rb +1 -0
- data/lib/graphql/schema/list.rb +1 -0
- data/lib/graphql/schema/loader.rb +1 -0
- data/lib/graphql/schema/member/base_dsl_methods.rb +1 -0
- data/lib/graphql/schema/member/build_type.rb +1 -0
- data/lib/graphql/schema/member/graphql_type_names.rb +1 -0
- data/lib/graphql/schema/member/has_arguments.rb +1 -0
- data/lib/graphql/schema/member/has_ast_node.rb +7 -2
- data/lib/graphql/schema/member/has_authorization.rb +7 -4
- data/lib/graphql/schema/member/has_dataloader.rb +1 -0
- data/lib/graphql/schema/member/has_deprecation_reason.rb +7 -2
- data/lib/graphql/schema/member/has_directives.rb +1 -0
- data/lib/graphql/schema/member/has_fields.rb +1 -0
- data/lib/graphql/schema/member/has_interfaces.rb +1 -0
- data/lib/graphql/schema/member/has_path.rb +1 -0
- data/lib/graphql/schema/member/has_unresolved_type_error.rb +1 -0
- data/lib/graphql/schema/member/has_validators.rb +1 -0
- data/lib/graphql/schema/member/relay_shortcuts.rb +1 -0
- data/lib/graphql/schema/member/scoped.rb +7 -3
- data/lib/graphql/schema/member/type_system_helpers.rb +1 -0
- data/lib/graphql/schema/member/validates_input.rb +7 -1
- data/lib/graphql/schema/member.rb +1 -0
- data/lib/graphql/schema/mutation.rb +1 -0
- data/lib/graphql/schema/non_null.rb +1 -0
- data/lib/graphql/schema/object.rb +1 -0
- data/lib/graphql/schema/printer.rb +1 -0
- data/lib/graphql/schema/ractor_shareable.rb +1 -0
- data/lib/graphql/schema/relay_classic_mutation.rb +8 -3
- data/lib/graphql/schema/resolver/has_payload_type.rb +1 -0
- data/lib/graphql/schema/resolver.rb +3 -1
- data/lib/graphql/schema/scalar.rb +27 -3
- data/lib/graphql/schema/subscription.rb +1 -0
- data/lib/graphql/schema/timeout.rb +1 -0
- data/lib/graphql/schema/type_expression.rb +1 -0
- data/lib/graphql/schema/type_membership.rb +1 -0
- data/lib/graphql/schema/union.rb +1 -0
- data/lib/graphql/schema/unique_within_type.rb +1 -0
- data/lib/graphql/schema/validator/all_validator.rb +1 -0
- data/lib/graphql/schema/validator/allow_blank_validator.rb +5 -2
- data/lib/graphql/schema/validator/allow_null_validator.rb +6 -3
- data/lib/graphql/schema/validator/exclusion_validator.rb +7 -4
- data/lib/graphql/schema/validator/format_validator.rb +7 -4
- data/lib/graphql/schema/validator/inclusion_validator.rb +6 -3
- data/lib/graphql/schema/validator/length_validator.rb +1 -0
- data/lib/graphql/schema/validator/numericality_validator.rb +1 -0
- data/lib/graphql/schema/validator/required_validator.rb +1 -0
- data/lib/graphql/schema/validator.rb +3 -2
- data/lib/graphql/schema/visibility/migration.rb +1 -0
- data/lib/graphql/schema/visibility/profile.rb +1 -0
- data/lib/graphql/schema/visibility/visit.rb +1 -0
- data/lib/graphql/schema/visibility.rb +1 -0
- data/lib/graphql/schema/warden.rb +1 -0
- data/lib/graphql/schema/wrapper.rb +1 -0
- data/lib/graphql/schema.rb +1 -0
- data/lib/graphql/static_validation/all_rules.rb +1 -0
- data/lib/graphql/static_validation/base_visitor.rb +1 -0
- data/lib/graphql/static_validation/definition_dependencies.rb +1 -0
- data/lib/graphql/static_validation/error.rb +14 -5
- data/lib/graphql/static_validation/interpreter_visitor.rb +1 -0
- data/lib/graphql/static_validation/rules/argument_literals_are_compatible.rb +9 -3
- data/lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb +16 -8
- data/lib/graphql/static_validation/rules/argument_names_are_unique.rb +1 -0
- data/lib/graphql/static_validation/rules/argument_names_are_unique_error.rb +8 -3
- data/lib/graphql/static_validation/rules/arguments_are_defined.rb +10 -4
- data/lib/graphql/static_validation/rules/arguments_are_defined_error.rb +14 -6
- data/lib/graphql/static_validation/rules/directives_are_defined.rb +7 -9
- data/lib/graphql/static_validation/rules/directives_are_defined_error.rb +8 -3
- data/lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb +12 -7
- data/lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb +10 -4
- data/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb +1 -0
- data/lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb +10 -4
- data/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb +1 -0
- data/lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb +10 -4
- data/lib/graphql/static_validation/rules/fields_will_merge.rb +2 -3
- data/lib/graphql/static_validation/rules/fields_will_merge_error.rb +15 -4
- data/lib/graphql/static_validation/rules/fragment_names_are_unique.rb +10 -5
- data/lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb +8 -3
- data/lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb +30 -14
- data/lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb +12 -5
- data/lib/graphql/static_validation/rules/fragment_types_exist.rb +11 -6
- data/lib/graphql/static_validation/rules/fragment_types_exist_error.rb +8 -3
- data/lib/graphql/static_validation/rules/fragments_are_finite.rb +1 -0
- data/lib/graphql/static_validation/rules/fragments_are_finite_error.rb +8 -3
- data/lib/graphql/static_validation/rules/fragments_are_named.rb +1 -0
- data/lib/graphql/static_validation/rules/fragments_are_named_error.rb +1 -0
- data/lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb +1 -0
- data/lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb +8 -4
- data/lib/graphql/static_validation/rules/fragments_are_used.rb +1 -0
- data/lib/graphql/static_validation/rules/fragments_are_used_error.rb +8 -3
- data/lib/graphql/static_validation/rules/input_object_names_are_unique.rb +1 -0
- data/lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb +8 -3
- data/lib/graphql/static_validation/rules/mutation_root_exists.rb +1 -0
- data/lib/graphql/static_validation/rules/mutation_root_exists_error.rb +1 -0
- data/lib/graphql/static_validation/rules/no_definitions_are_present.rb +7 -3
- data/lib/graphql/static_validation/rules/no_definitions_are_present_error.rb +1 -0
- data/lib/graphql/static_validation/rules/not_single_subscription_error.rb +1 -0
- data/lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb +10 -4
- data/lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb +7 -2
- data/lib/graphql/static_validation/rules/operation_names_are_valid.rb +10 -4
- data/lib/graphql/static_validation/rules/operation_names_are_valid_error.rb +7 -2
- data/lib/graphql/static_validation/rules/query_root_exists.rb +1 -0
- data/lib/graphql/static_validation/rules/query_root_exists_error.rb +1 -0
- data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +19 -10
- data/lib/graphql/static_validation/rules/required_arguments_are_present_error.rb +12 -5
- data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb +5 -1
- data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb +1 -0
- data/lib/graphql/static_validation/rules/subscription_root_exists_and_single_subscription_selection.rb +1 -0
- data/lib/graphql/static_validation/rules/subscription_root_exists_error.rb +1 -0
- data/lib/graphql/static_validation/rules/unique_directives_per_location.rb +2 -1
- data/lib/graphql/static_validation/rules/unique_directives_per_location_error.rb +8 -3
- data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb +1 -0
- data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb +13 -6
- data/lib/graphql/static_validation/rules/variable_names_are_unique.rb +1 -0
- data/lib/graphql/static_validation/rules/variable_names_are_unique_error.rb +8 -3
- data/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb +16 -8
- data/lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb +14 -6
- data/lib/graphql/static_validation/rules/variables_are_input_types.rb +8 -5
- data/lib/graphql/static_validation/rules/variables_are_input_types_error.rb +10 -4
- data/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb +1 -0
- data/lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb +11 -5
- data/lib/graphql/static_validation/validation_context.rb +4 -1
- data/lib/graphql/static_validation/validation_timeout_error.rb +1 -0
- data/lib/graphql/static_validation/validator.rb +7 -3
- data/lib/graphql/static_validation.rb +1 -0
- data/lib/graphql/string_encoding_error.rb +1 -0
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +1 -0
- data/lib/graphql/subscriptions/broadcast_analyzer.rb +1 -0
- data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +1 -0
- data/lib/graphql/subscriptions/event.rb +1 -0
- data/lib/graphql/subscriptions/serialize.rb +1 -0
- data/lib/graphql/subscriptions.rb +1 -0
- data/lib/graphql/testing/helpers.rb +1 -0
- data/lib/graphql/testing/mock_action_cable.rb +1 -0
- data/lib/graphql/testing.rb +1 -0
- data/lib/graphql/tracing/active_support_notifications_trace.rb +1 -0
- data/lib/graphql/tracing/active_support_notifications_tracing.rb +1 -0
- data/lib/graphql/tracing/appoptics_trace.rb +1 -0
- data/lib/graphql/tracing/appoptics_tracing.rb +1 -0
- data/lib/graphql/tracing/appsignal_trace.rb +1 -0
- data/lib/graphql/tracing/appsignal_tracing.rb +1 -0
- data/lib/graphql/tracing/call_legacy_tracers.rb +1 -0
- data/lib/graphql/tracing/data_dog_trace.rb +1 -0
- data/lib/graphql/tracing/data_dog_tracing.rb +1 -0
- data/lib/graphql/tracing/detailed_trace/active_record_backend.rb +1 -0
- data/lib/graphql/tracing/detailed_trace/memory_backend.rb +1 -0
- data/lib/graphql/tracing/detailed_trace/redis_backend.rb +1 -0
- data/lib/graphql/tracing/detailed_trace.rb +1 -0
- data/lib/graphql/tracing/legacy_hooks_trace.rb +1 -0
- data/lib/graphql/tracing/legacy_trace.rb +1 -0
- data/lib/graphql/tracing/monitor_trace.rb +1 -0
- data/lib/graphql/tracing/new_relic_trace.rb +1 -0
- data/lib/graphql/tracing/new_relic_tracing.rb +1 -0
- data/lib/graphql/tracing/notifications_trace.rb +1 -0
- data/lib/graphql/tracing/notifications_tracing.rb +1 -0
- data/lib/graphql/tracing/null_trace.rb +1 -0
- data/lib/graphql/tracing/perfetto_trace/trace_pb.rb +1 -0
- data/lib/graphql/tracing/perfetto_trace.rb +1 -0
- data/lib/graphql/tracing/platform_trace.rb +1 -0
- data/lib/graphql/tracing/platform_tracing.rb +1 -0
- data/lib/graphql/tracing/prometheus_trace/graphql_collector.rb +1 -0
- data/lib/graphql/tracing/prometheus_trace.rb +1 -0
- data/lib/graphql/tracing/prometheus_tracing.rb +1 -0
- data/lib/graphql/tracing/scout_trace.rb +1 -0
- data/lib/graphql/tracing/scout_tracing.rb +1 -0
- data/lib/graphql/tracing/sentry_trace.rb +1 -0
- data/lib/graphql/tracing/statsd_trace.rb +1 -0
- data/lib/graphql/tracing/statsd_tracing.rb +1 -0
- data/lib/graphql/tracing/trace.rb +1 -0
- data/lib/graphql/tracing.rb +1 -0
- data/lib/graphql/type_kinds.rb +1 -0
- data/lib/graphql/types/big_int.rb +1 -0
- data/lib/graphql/types/boolean.rb +1 -0
- data/lib/graphql/types/float.rb +4 -1
- data/lib/graphql/types/id.rb +1 -0
- data/lib/graphql/types/int.rb +6 -3
- data/lib/graphql/types/iso_8601_date.rb +3 -1
- data/lib/graphql/types/iso_8601_date_time.rb +1 -0
- data/lib/graphql/types/iso_8601_duration.rb +4 -2
- data/lib/graphql/types/json.rb +4 -1
- data/lib/graphql/types/relay/base_connection.rb +1 -0
- data/lib/graphql/types/relay/base_edge.rb +1 -0
- data/lib/graphql/types/relay/connection_behaviors.rb +1 -2
- data/lib/graphql/types/relay/edge_behaviors.rb +1 -2
- data/lib/graphql/types/relay/has_node_field.rb +7 -1
- data/lib/graphql/types/relay/has_nodes_field.rb +7 -1
- data/lib/graphql/types/relay/node.rb +1 -0
- data/lib/graphql/types/relay/node_behaviors.rb +7 -1
- data/lib/graphql/types/relay/page_info.rb +1 -0
- data/lib/graphql/types/relay/page_info_behaviors.rb +1 -0
- data/lib/graphql/types/relay.rb +1 -0
- data/lib/graphql/types/string.rb +3 -1
- data/lib/graphql/types.rb +1 -0
- data/lib/graphql/unauthorized_enum_value_error.rb +1 -0
- data/lib/graphql/unauthorized_error.rb +1 -0
- data/lib/graphql/unauthorized_field_error.rb +1 -0
- data/lib/graphql/unresolved_type_error.rb +1 -0
- data/lib/graphql/version.rb +2 -1
- data/lib/graphql.rb +1 -0
- metadata +2 -2
|
@@ -1,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,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?
|
data/lib/graphql/query/result.rb
CHANGED
data/lib/graphql/query.rb
CHANGED
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,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
|
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
|
|
@@ -8,13 +9,15 @@ module GraphQL
|
|
|
8
9
|
locations(GraphQL::Schema::Directive::INPUT_OBJECT)
|
|
9
10
|
default_directive true
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
#: (singleton(GraphQL::Schema::InputObject) owner, **untyped arguments) -> void
|
|
13
|
+
def initialize(owner, **arguments)
|
|
12
14
|
super
|
|
13
15
|
|
|
14
16
|
owner.extend(IsOneOf)
|
|
15
17
|
end
|
|
16
18
|
|
|
17
19
|
module IsOneOf
|
|
20
|
+
#: -> bool
|
|
18
21
|
def one_of?
|
|
19
22
|
true
|
|
20
23
|
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
|
|
@@ -40,9 +41,10 @@ module GraphQL
|
|
|
40
41
|
"upcase",
|
|
41
42
|
"downcase",
|
|
42
43
|
# ??
|
|
43
|
-
]
|
|
44
|
+
] #: Array[String]
|
|
44
45
|
# Implement the Directive API
|
|
45
|
-
|
|
46
|
+
#: (untyped object, Hash[Symbol, untyped] arguments, GraphQL::Query::Context context) { () -> untyped } -> nil
|
|
47
|
+
def self.resolve(object, arguments, context, &block)
|
|
46
48
|
path = context.namespace(:interpreter)[:current_path]
|
|
47
49
|
return_value = yield
|
|
48
50
|
transform_name = arguments[:by]
|
|
@@ -64,6 +66,7 @@ module GraphQL
|
|
|
64
66
|
end
|
|
65
67
|
end
|
|
66
68
|
|
|
69
|
+
#: (Array[GraphQL::Language::Nodes::Field] ast_nodes, untyped parent_type, GraphQL::Schema::Field field_defn, Array[untyped] objects, Hash[Symbol, untyped] arguments, GraphQL::Query::Context context) -> Transformer?
|
|
67
70
|
def self.resolve_field(ast_nodes, parent_type, field_defn, objects, arguments, context)
|
|
68
71
|
transform_name = arguments[:by]
|
|
69
72
|
if TRANSFORMS.include?(transform_name)
|
|
@@ -75,9 +78,11 @@ module GraphQL
|
|
|
75
78
|
|
|
76
79
|
class Transformer
|
|
77
80
|
include Execution::PostProcessor
|
|
81
|
+
#: (String transform) -> void
|
|
78
82
|
def initialize(transform)
|
|
79
|
-
@transform = transform
|
|
83
|
+
@transform = transform #: String
|
|
80
84
|
end
|
|
85
|
+
#: (Array[untyped] field_results) -> Array[untyped]
|
|
81
86
|
def after_resolve(field_results)
|
|
82
87
|
field_results.map! { |r| r.respond_to?(@transform) ? r.public_send(@transform) : r }
|
|
83
88
|
field_results
|
data/lib/graphql/schema/enum.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
|
|
@@ -7,6 +8,7 @@ module GraphQL
|
|
|
7
8
|
class ConnectionExtension < GraphQL::Schema::FieldExtension
|
|
8
9
|
extras [:lookahead]
|
|
9
10
|
|
|
11
|
+
#: -> void
|
|
10
12
|
def apply
|
|
11
13
|
field.argument :after, "String", "Returns the elements in the list that come after the specified cursor.", required: false
|
|
12
14
|
field.argument :before, "String", "Returns the elements in the list that come before the specified cursor.", required: false
|
|
@@ -15,7 +17,8 @@ module GraphQL
|
|
|
15
17
|
end
|
|
16
18
|
|
|
17
19
|
# Remove pagination args before passing it to a user method
|
|
18
|
-
|
|
20
|
+
#: (arguments: Hash[Symbol, untyped], context: GraphQL::Query::Context, ?object: untyped, ?objects: untyped) { (untyped, Hash[Symbol, untyped], Hash[Symbol, untyped]) -> untyped } -> untyped
|
|
21
|
+
def resolve(arguments:, context:, object: nil, objects: nil, &block)
|
|
19
22
|
next_args = arguments.dup
|
|
20
23
|
next_args.delete(:first)
|
|
21
24
|
next_args.delete(:last)
|
|
@@ -26,6 +29,7 @@ module GraphQL
|
|
|
26
29
|
yield(object || objects, next_args, original_arguments)
|
|
27
30
|
end
|
|
28
31
|
|
|
32
|
+
#: (value: untyped, object: untyped, arguments: Hash[Symbol, untyped], context: GraphQL::Query::Context, memo: untyped) -> untyped
|
|
29
33
|
def after_resolve(value:, object:, arguments:, context:, memo:)
|
|
30
34
|
original_arguments = memo
|
|
31
35
|
lookahead = arguments[:lookahead]
|
data/lib/graphql/schema/field.rb
CHANGED