graphql 1.13.17 → 2.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/graphql/install_generator.rb +1 -1
- data/lib/generators/graphql/relay.rb +3 -17
- data/lib/generators/graphql/templates/schema.erb +3 -0
- data/lib/graphql/analysis/ast/field_usage.rb +3 -1
- data/lib/graphql/analysis/ast/max_query_complexity.rb +0 -1
- data/lib/graphql/analysis/ast/query_complexity.rb +1 -1
- data/lib/graphql/analysis/ast/query_depth.rb +0 -1
- data/lib/graphql/analysis/ast/visitor.rb +43 -36
- data/lib/graphql/analysis/ast.rb +2 -12
- data/lib/graphql/analysis.rb +0 -7
- data/lib/graphql/backtrace/table.rb +2 -20
- data/lib/graphql/backtrace/tracer.rb +2 -3
- data/lib/graphql/backtrace.rb +2 -8
- data/lib/graphql/dataloader/null_dataloader.rb +3 -1
- data/lib/graphql/dataloader/source.rb +9 -0
- data/lib/graphql/dataloader.rb +4 -1
- data/lib/graphql/dig.rb +1 -1
- data/lib/graphql/execution/errors.rb +12 -82
- data/lib/graphql/execution/interpreter/resolve.rb +26 -0
- data/lib/graphql/execution/interpreter/runtime.rb +159 -120
- data/lib/graphql/execution/interpreter.rb +187 -78
- data/lib/graphql/execution/lazy.rb +7 -21
- data/lib/graphql/execution/lookahead.rb +44 -40
- data/lib/graphql/execution/multiplex.rb +3 -174
- data/lib/graphql/execution.rb +11 -4
- data/lib/graphql/introspection/directive_type.rb +2 -2
- data/lib/graphql/introspection/dynamic_fields.rb +3 -8
- data/lib/graphql/introspection/entry_points.rb +2 -15
- data/lib/graphql/introspection/field_type.rb +1 -1
- data/lib/graphql/introspection/schema_type.rb +2 -2
- data/lib/graphql/introspection/type_type.rb +13 -6
- data/lib/graphql/introspection.rb +4 -3
- data/lib/graphql/language/document_from_schema_definition.rb +18 -35
- data/lib/graphql/language/lexer.rb +216 -1488
- data/lib/graphql/language/nodes.rb +65 -39
- data/lib/graphql/language/parser.rb +376 -364
- data/lib/graphql/language/parser.y +49 -44
- data/lib/graphql/language/printer.rb +37 -21
- data/lib/graphql/language/visitor.rb +191 -83
- data/lib/graphql/pagination/active_record_relation_connection.rb +0 -8
- data/lib/graphql/pagination/array_connection.rb +4 -2
- data/lib/graphql/pagination/connection.rb +31 -4
- data/lib/graphql/pagination/connections.rb +3 -28
- data/lib/graphql/pagination/relation_connection.rb +2 -0
- data/lib/graphql/query/context.rb +155 -196
- data/lib/graphql/query/input_validation_result.rb +1 -1
- data/lib/graphql/query/null_context.rb +0 -3
- data/lib/graphql/query/validation_pipeline.rb +10 -34
- data/lib/graphql/query/variables.rb +7 -20
- data/lib/graphql/query.rb +32 -42
- data/lib/graphql/railtie.rb +0 -104
- data/lib/graphql/rake_task/validate.rb +1 -1
- data/lib/graphql/rake_task.rb +29 -1
- data/lib/graphql/relay/range_add.rb +9 -20
- data/lib/graphql/relay.rb +0 -15
- data/lib/graphql/schema/addition.rb +7 -9
- data/lib/graphql/schema/argument.rb +36 -43
- data/lib/graphql/schema/build_from_definition.rb +32 -18
- data/lib/graphql/schema/directive/one_of.rb +12 -0
- data/lib/graphql/schema/directive/transform.rb +1 -1
- data/lib/graphql/schema/directive.rb +12 -23
- data/lib/graphql/schema/enum.rb +28 -39
- data/lib/graphql/schema/enum_value.rb +5 -25
- data/lib/graphql/schema/field/connection_extension.rb +4 -0
- data/lib/graphql/schema/field.rb +237 -339
- data/lib/graphql/schema/input_object.rb +56 -67
- data/lib/graphql/schema/interface.rb +0 -35
- data/lib/graphql/schema/introspection_system.rb +3 -8
- data/lib/graphql/schema/late_bound_type.rb +8 -2
- data/lib/graphql/schema/list.rb +0 -6
- data/lib/graphql/schema/loader.rb +1 -2
- data/lib/graphql/schema/member/base_dsl_methods.rb +17 -19
- data/lib/graphql/schema/member/build_type.rb +5 -7
- data/lib/graphql/schema/member/has_arguments.rb +146 -55
- data/lib/graphql/schema/member/has_ast_node.rb +12 -0
- data/lib/graphql/schema/member/has_deprecation_reason.rb +3 -4
- data/lib/graphql/schema/member/has_directives.rb +81 -59
- data/lib/graphql/schema/member/has_fields.rb +17 -4
- data/lib/graphql/schema/member/has_interfaces.rb +49 -10
- data/lib/graphql/schema/member/has_validators.rb +31 -5
- data/lib/graphql/schema/member/relay_shortcuts.rb +47 -2
- data/lib/graphql/schema/member/type_system_helpers.rb +17 -0
- data/lib/graphql/schema/member/validates_input.rb +1 -1
- data/lib/graphql/schema/member.rb +0 -6
- data/lib/graphql/schema/mutation.rb +0 -9
- data/lib/graphql/schema/non_null.rb +1 -7
- data/lib/graphql/schema/object.rb +15 -52
- data/lib/graphql/schema/relay_classic_mutation.rb +53 -42
- data/lib/graphql/schema/resolver/has_payload_type.rb +20 -10
- data/lib/graphql/schema/resolver.rb +41 -42
- data/lib/graphql/schema/scalar.rb +7 -22
- data/lib/graphql/schema/subscription.rb +0 -7
- data/lib/graphql/schema/timeout.rb +24 -28
- data/lib/graphql/schema/type_membership.rb +3 -0
- data/lib/graphql/schema/union.rb +10 -17
- data/lib/graphql/schema/warden.rb +34 -8
- data/lib/graphql/schema/wrapper.rb +0 -5
- data/lib/graphql/schema.rb +241 -973
- data/lib/graphql/static_validation/all_rules.rb +1 -0
- data/lib/graphql/static_validation/base_visitor.rb +4 -21
- data/lib/graphql/static_validation/definition_dependencies.rb +7 -1
- data/lib/graphql/static_validation/error.rb +2 -2
- data/lib/graphql/static_validation/literal_validator.rb +19 -1
- data/lib/graphql/static_validation/rules/directives_are_defined.rb +11 -5
- data/lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb +12 -12
- data/lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb +66 -0
- data/lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb +29 -0
- data/lib/graphql/static_validation/rules/unique_directives_per_location.rb +12 -6
- data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb +1 -1
- data/lib/graphql/static_validation/validator.rb +3 -25
- data/lib/graphql/static_validation.rb +0 -2
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +7 -1
- data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +38 -1
- data/lib/graphql/subscriptions/event.rb +3 -8
- data/lib/graphql/subscriptions/instrumentation.rb +0 -51
- data/lib/graphql/subscriptions.rb +32 -20
- data/lib/graphql/tracing/active_support_notifications_trace.rb +16 -0
- data/lib/graphql/tracing/appoptics_trace.rb +231 -0
- data/lib/graphql/tracing/appsignal_trace.rb +71 -0
- data/lib/graphql/tracing/data_dog_trace.rb +148 -0
- data/lib/graphql/tracing/data_dog_tracing.rb +2 -0
- data/lib/graphql/tracing/new_relic_trace.rb +75 -0
- data/lib/graphql/tracing/notifications_trace.rb +41 -0
- data/lib/graphql/tracing/platform_trace.rb +107 -0
- data/lib/graphql/tracing/platform_tracing.rb +26 -40
- data/lib/graphql/tracing/prometheus_trace.rb +89 -0
- data/lib/graphql/tracing/prometheus_tracing.rb +3 -3
- data/lib/graphql/tracing/scout_trace.rb +72 -0
- data/lib/graphql/tracing/statsd_trace.rb +56 -0
- data/lib/graphql/tracing.rb +136 -40
- data/lib/graphql/type_kinds.rb +6 -3
- data/lib/graphql/types/iso_8601_date.rb +4 -1
- data/lib/graphql/types/iso_8601_date_time.rb +4 -0
- data/lib/graphql/types/relay/base_connection.rb +16 -6
- data/lib/graphql/types/relay/connection_behaviors.rb +29 -27
- data/lib/graphql/types/relay/edge_behaviors.rb +16 -5
- data/lib/graphql/types/relay/node_behaviors.rb +12 -2
- data/lib/graphql/types/relay/page_info_behaviors.rb +7 -2
- data/lib/graphql/types/relay.rb +0 -3
- data/lib/graphql/types/string.rb +1 -1
- data/lib/graphql/version.rb +1 -1
- data/lib/graphql.rb +13 -74
- metadata +30 -133
- data/lib/graphql/analysis/analyze_query.rb +0 -98
- data/lib/graphql/analysis/field_usage.rb +0 -45
- data/lib/graphql/analysis/max_query_complexity.rb +0 -26
- data/lib/graphql/analysis/max_query_depth.rb +0 -26
- data/lib/graphql/analysis/query_complexity.rb +0 -88
- data/lib/graphql/analysis/query_depth.rb +0 -43
- data/lib/graphql/analysis/reducer_state.rb +0 -48
- data/lib/graphql/argument.rb +0 -131
- data/lib/graphql/authorization.rb +0 -82
- data/lib/graphql/backtrace/legacy_tracer.rb +0 -56
- data/lib/graphql/backwards_compatibility.rb +0 -61
- data/lib/graphql/base_type.rb +0 -232
- data/lib/graphql/boolean_type.rb +0 -2
- data/lib/graphql/compatibility/execution_specification/counter_schema.rb +0 -53
- data/lib/graphql/compatibility/execution_specification/specification_schema.rb +0 -200
- data/lib/graphql/compatibility/execution_specification.rb +0 -436
- data/lib/graphql/compatibility/lazy_execution_specification/lazy_schema.rb +0 -111
- data/lib/graphql/compatibility/lazy_execution_specification.rb +0 -215
- data/lib/graphql/compatibility/query_parser_specification/parse_error_specification.rb +0 -87
- data/lib/graphql/compatibility/query_parser_specification/query_assertions.rb +0 -79
- data/lib/graphql/compatibility/query_parser_specification.rb +0 -266
- data/lib/graphql/compatibility/schema_parser_specification.rb +0 -682
- data/lib/graphql/compatibility.rb +0 -5
- data/lib/graphql/define/assign_argument.rb +0 -12
- data/lib/graphql/define/assign_connection.rb +0 -13
- data/lib/graphql/define/assign_enum_value.rb +0 -18
- data/lib/graphql/define/assign_global_id_field.rb +0 -11
- data/lib/graphql/define/assign_mutation_function.rb +0 -34
- data/lib/graphql/define/assign_object_field.rb +0 -42
- data/lib/graphql/define/defined_object_proxy.rb +0 -53
- data/lib/graphql/define/instance_definable.rb +0 -255
- data/lib/graphql/define/no_definition_error.rb +0 -7
- data/lib/graphql/define/non_null_with_bang.rb +0 -16
- data/lib/graphql/define/type_definer.rb +0 -31
- data/lib/graphql/define.rb +0 -31
- data/lib/graphql/deprecated_dsl.rb +0 -55
- data/lib/graphql/directive/deprecated_directive.rb +0 -2
- data/lib/graphql/directive/include_directive.rb +0 -2
- data/lib/graphql/directive/skip_directive.rb +0 -2
- data/lib/graphql/directive.rb +0 -107
- data/lib/graphql/enum_type.rb +0 -133
- data/lib/graphql/execution/execute.rb +0 -333
- data/lib/graphql/execution/flatten.rb +0 -40
- data/lib/graphql/execution/instrumentation.rb +0 -92
- data/lib/graphql/execution/lazy/resolve.rb +0 -91
- data/lib/graphql/execution/typecast.rb +0 -50
- data/lib/graphql/field/resolve.rb +0 -59
- data/lib/graphql/field.rb +0 -226
- data/lib/graphql/float_type.rb +0 -2
- data/lib/graphql/function.rb +0 -128
- data/lib/graphql/id_type.rb +0 -2
- data/lib/graphql/input_object_type.rb +0 -138
- data/lib/graphql/int_type.rb +0 -2
- data/lib/graphql/interface_type.rb +0 -72
- data/lib/graphql/internal_representation/document.rb +0 -27
- data/lib/graphql/internal_representation/node.rb +0 -206
- data/lib/graphql/internal_representation/print.rb +0 -51
- data/lib/graphql/internal_representation/rewrite.rb +0 -184
- data/lib/graphql/internal_representation/scope.rb +0 -88
- data/lib/graphql/internal_representation/visit.rb +0 -36
- data/lib/graphql/internal_representation.rb +0 -7
- data/lib/graphql/language/lexer.rl +0 -260
- data/lib/graphql/list_type.rb +0 -80
- data/lib/graphql/non_null_type.rb +0 -71
- data/lib/graphql/object_type.rb +0 -130
- data/lib/graphql/query/arguments.rb +0 -189
- data/lib/graphql/query/arguments_cache.rb +0 -24
- data/lib/graphql/query/executor.rb +0 -52
- data/lib/graphql/query/literal_input.rb +0 -136
- data/lib/graphql/query/serial_execution/field_resolution.rb +0 -92
- data/lib/graphql/query/serial_execution/operation_resolution.rb +0 -19
- data/lib/graphql/query/serial_execution/selection_resolution.rb +0 -23
- data/lib/graphql/query/serial_execution/value_resolution.rb +0 -87
- data/lib/graphql/query/serial_execution.rb +0 -40
- data/lib/graphql/relay/array_connection.rb +0 -83
- data/lib/graphql/relay/base_connection.rb +0 -189
- data/lib/graphql/relay/connection_instrumentation.rb +0 -54
- data/lib/graphql/relay/connection_resolve.rb +0 -43
- data/lib/graphql/relay/connection_type.rb +0 -54
- data/lib/graphql/relay/edge.rb +0 -27
- data/lib/graphql/relay/edge_type.rb +0 -19
- data/lib/graphql/relay/edges_instrumentation.rb +0 -39
- data/lib/graphql/relay/global_id_resolve.rb +0 -17
- data/lib/graphql/relay/mongo_relation_connection.rb +0 -50
- data/lib/graphql/relay/mutation/instrumentation.rb +0 -23
- data/lib/graphql/relay/mutation/resolve.rb +0 -56
- data/lib/graphql/relay/mutation/result.rb +0 -38
- data/lib/graphql/relay/mutation.rb +0 -106
- data/lib/graphql/relay/node.rb +0 -39
- data/lib/graphql/relay/page_info.rb +0 -7
- data/lib/graphql/relay/relation_connection.rb +0 -188
- data/lib/graphql/relay/type_extensions.rb +0 -32
- data/lib/graphql/scalar_type.rb +0 -91
- data/lib/graphql/schema/catchall_middleware.rb +0 -35
- data/lib/graphql/schema/default_parse_error.rb +0 -10
- data/lib/graphql/schema/default_type_error.rb +0 -17
- data/lib/graphql/schema/member/accepts_definition.rb +0 -164
- data/lib/graphql/schema/member/cached_graphql_definition.rb +0 -58
- data/lib/graphql/schema/member/instrumentation.rb +0 -131
- data/lib/graphql/schema/middleware_chain.rb +0 -82
- data/lib/graphql/schema/possible_types.rb +0 -44
- data/lib/graphql/schema/rescue_middleware.rb +0 -60
- data/lib/graphql/schema/timeout_middleware.rb +0 -88
- data/lib/graphql/schema/traversal.rb +0 -228
- data/lib/graphql/schema/validation.rb +0 -313
- data/lib/graphql/static_validation/default_visitor.rb +0 -15
- data/lib/graphql/static_validation/no_validate_visitor.rb +0 -10
- data/lib/graphql/string_type.rb +0 -2
- data/lib/graphql/subscriptions/subscription_root.rb +0 -76
- data/lib/graphql/tracing/skylight_tracing.rb +0 -70
- data/lib/graphql/types/relay/default_relay.rb +0 -31
- data/lib/graphql/types/relay/node_field.rb +0 -24
- data/lib/graphql/types/relay/nodes_field.rb +0 -43
- data/lib/graphql/union_type.rb +0 -115
- data/lib/graphql/upgrader/member.rb +0 -937
- data/lib/graphql/upgrader/schema.rb +0 -38
data/lib/graphql.rb
CHANGED
@@ -42,8 +42,8 @@ This is probably a bug in GraphQL-Ruby, please report this error on GitHub: http
|
|
42
42
|
# Turn a query string or schema definition into an AST
|
43
43
|
# @param graphql_string [String] a GraphQL query string or schema definition
|
44
44
|
# @return [GraphQL::Language::Nodes::Document]
|
45
|
-
def self.parse(graphql_string,
|
46
|
-
|
45
|
+
def self.parse(graphql_string, trace: GraphQL::Tracing::NullTrace)
|
46
|
+
default_parser.parse(graphql_string, trace: trace)
|
47
47
|
end
|
48
48
|
|
49
49
|
# Read the contents of `filename` and parse them as GraphQL
|
@@ -51,21 +51,24 @@ This is probably a bug in GraphQL-Ruby, please report this error on GitHub: http
|
|
51
51
|
# @return [GraphQL::Language::Nodes::Document]
|
52
52
|
def self.parse_file(filename)
|
53
53
|
content = File.read(filename)
|
54
|
-
|
54
|
+
default_parser.parse(content, filename: filename)
|
55
55
|
end
|
56
56
|
|
57
|
-
|
58
|
-
|
57
|
+
# @return [Array<Array>]
|
58
|
+
def self.scan(graphql_string)
|
59
|
+
default_parser.scan(graphql_string)
|
59
60
|
end
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
scan_with_ragel(graphql_string)
|
62
|
+
def self.parse_with_racc(string, filename: nil, trace: GraphQL::Tracing::NullTrace)
|
63
|
+
GraphQL::Language::Parser.parse(string, filename: filename, trace: trace)
|
64
64
|
end
|
65
65
|
|
66
|
-
def self.
|
66
|
+
def self.scan_with_ruby(graphql_string)
|
67
67
|
GraphQL::Language::Lexer.tokenize(graphql_string)
|
68
68
|
end
|
69
|
+
|
70
|
+
NOT_CONFIGURED = Object.new
|
71
|
+
private_constant :NOT_CONFIGURED
|
69
72
|
end
|
70
73
|
|
71
74
|
# Order matters for these:
|
@@ -81,27 +84,8 @@ require "graphql/integer_decoding_error"
|
|
81
84
|
require "graphql/integer_encoding_error"
|
82
85
|
require "graphql/string_encoding_error"
|
83
86
|
require "graphql/date_encoding_error"
|
84
|
-
|
85
|
-
require "graphql/define"
|
86
|
-
require "graphql/deprecation"
|
87
|
-
require "graphql/base_type"
|
88
|
-
require "graphql/object_type"
|
89
|
-
require "graphql/enum_type"
|
90
|
-
require "graphql/input_object_type"
|
91
|
-
require "graphql/interface_type"
|
92
|
-
require "graphql/list_type"
|
93
|
-
require "graphql/non_null_type"
|
94
|
-
require "graphql/union_type"
|
95
|
-
|
96
|
-
require "graphql/argument"
|
97
|
-
require "graphql/field"
|
98
87
|
require "graphql/type_kinds"
|
99
|
-
|
100
|
-
require "graphql/backwards_compatibility"
|
101
|
-
require "graphql/scalar_type"
|
102
|
-
|
103
88
|
require "graphql/name_validator"
|
104
|
-
|
105
89
|
require "graphql/language"
|
106
90
|
|
107
91
|
require_relative "./graphql/railtie" if defined? Rails::Railtie
|
@@ -116,15 +100,8 @@ require "graphql/query"
|
|
116
100
|
require "graphql/types"
|
117
101
|
require "graphql/dataloader"
|
118
102
|
require "graphql/filter"
|
119
|
-
require "graphql/internal_representation"
|
120
|
-
require "graphql/directive"
|
121
103
|
require "graphql/static_validation"
|
122
104
|
require "graphql/execution"
|
123
|
-
require "graphql/boolean_type"
|
124
|
-
require "graphql/float_type"
|
125
|
-
require "graphql/id_type"
|
126
|
-
require "graphql/int_type"
|
127
|
-
require "graphql/string_type"
|
128
105
|
require "graphql/schema/built_in_types"
|
129
106
|
require "graphql/schema/loader"
|
130
107
|
require "graphql/schema/printer"
|
@@ -132,49 +109,11 @@ require "graphql/introspection"
|
|
132
109
|
require "graphql/relay"
|
133
110
|
|
134
111
|
require "graphql/version"
|
135
|
-
require "graphql/compatibility"
|
136
|
-
require "graphql/function"
|
137
112
|
require "graphql/subscriptions"
|
138
113
|
require "graphql/parse_error"
|
139
114
|
require "graphql/backtrace"
|
140
115
|
|
141
|
-
require "graphql/deprecated_dsl"
|
142
|
-
require "graphql/authorization"
|
143
116
|
require "graphql/unauthorized_error"
|
144
117
|
require "graphql/unauthorized_field_error"
|
145
118
|
require "graphql/load_application_object_failed_error"
|
146
|
-
require "graphql/
|
147
|
-
require "graphql/directive/skip_directive"
|
148
|
-
require "graphql/directive/deprecated_directive"
|
149
|
-
|
150
|
-
module GraphQL
|
151
|
-
# Ruby has `deprecate_constant`,
|
152
|
-
# but I don't see a way to give a nice error message in that case,
|
153
|
-
# so I'm doing this instead.
|
154
|
-
DEPRECATED_INT_TYPE = INT_TYPE
|
155
|
-
DEPRECATED_FLOAT_TYPE = FLOAT_TYPE
|
156
|
-
DEPRECATED_STRING_TYPE = STRING_TYPE
|
157
|
-
DEPRECATED_BOOLEAN_TYPE = BOOLEAN_TYPE
|
158
|
-
DEPRECATED_ID_TYPE = ID_TYPE
|
159
|
-
|
160
|
-
remove_const :INT_TYPE
|
161
|
-
remove_const :FLOAT_TYPE
|
162
|
-
remove_const :STRING_TYPE
|
163
|
-
remove_const :BOOLEAN_TYPE
|
164
|
-
remove_const :ID_TYPE
|
165
|
-
|
166
|
-
def self.const_missing(const_name)
|
167
|
-
deprecated_const_name = :"DEPRECATED_#{const_name}"
|
168
|
-
if const_defined?(deprecated_const_name)
|
169
|
-
deprecated_type = const_get(deprecated_const_name)
|
170
|
-
deprecated_caller = caller(1, 1).first
|
171
|
-
# Don't warn about internal uses, like `types.Int`
|
172
|
-
if !deprecated_caller.include?("lib/graphql")
|
173
|
-
warn "GraphQL::#{const_name} is deprecated and will be removed in GraphQL-Ruby 2.0, use GraphQL::Types::#{deprecated_type.graphql_name} instead. (from #{deprecated_caller})"
|
174
|
-
end
|
175
|
-
deprecated_type
|
176
|
-
else
|
177
|
-
super
|
178
|
-
end
|
179
|
-
end
|
180
|
-
end
|
119
|
+
require "graphql/deprecation"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Mosolgo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: benchmark-ips
|
@@ -112,44 +112,44 @@ dependencies:
|
|
112
112
|
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - "
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: rake-compiler
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
131
|
+
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
138
|
+
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: rubocop
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - '='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
145
|
+
version: '1.12'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - '='
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
152
|
+
version: '1.12'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: jekyll
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -291,7 +291,6 @@ files:
|
|
291
291
|
- lib/generators/graphql/union_generator.rb
|
292
292
|
- lib/graphql.rb
|
293
293
|
- lib/graphql/analysis.rb
|
294
|
-
- lib/graphql/analysis/analyze_query.rb
|
295
294
|
- lib/graphql/analysis/ast.rb
|
296
295
|
- lib/graphql/analysis/ast/analyzer.rb
|
297
296
|
- lib/graphql/analysis/ast/field_usage.rb
|
@@ -300,67 +299,24 @@ files:
|
|
300
299
|
- lib/graphql/analysis/ast/query_complexity.rb
|
301
300
|
- lib/graphql/analysis/ast/query_depth.rb
|
302
301
|
- lib/graphql/analysis/ast/visitor.rb
|
303
|
-
- lib/graphql/analysis/field_usage.rb
|
304
|
-
- lib/graphql/analysis/max_query_complexity.rb
|
305
|
-
- lib/graphql/analysis/max_query_depth.rb
|
306
|
-
- lib/graphql/analysis/query_complexity.rb
|
307
|
-
- lib/graphql/analysis/query_depth.rb
|
308
|
-
- lib/graphql/analysis/reducer_state.rb
|
309
302
|
- lib/graphql/analysis_error.rb
|
310
|
-
- lib/graphql/argument.rb
|
311
|
-
- lib/graphql/authorization.rb
|
312
303
|
- lib/graphql/backtrace.rb
|
313
304
|
- lib/graphql/backtrace/inspect_result.rb
|
314
|
-
- lib/graphql/backtrace/legacy_tracer.rb
|
315
305
|
- lib/graphql/backtrace/table.rb
|
316
306
|
- lib/graphql/backtrace/traced_error.rb
|
317
307
|
- lib/graphql/backtrace/tracer.rb
|
318
|
-
- lib/graphql/backwards_compatibility.rb
|
319
|
-
- lib/graphql/base_type.rb
|
320
|
-
- lib/graphql/boolean_type.rb
|
321
308
|
- lib/graphql/coercion_error.rb
|
322
|
-
- lib/graphql/compatibility.rb
|
323
|
-
- lib/graphql/compatibility/execution_specification.rb
|
324
|
-
- lib/graphql/compatibility/execution_specification/counter_schema.rb
|
325
|
-
- lib/graphql/compatibility/execution_specification/specification_schema.rb
|
326
|
-
- lib/graphql/compatibility/lazy_execution_specification.rb
|
327
|
-
- lib/graphql/compatibility/lazy_execution_specification/lazy_schema.rb
|
328
|
-
- lib/graphql/compatibility/query_parser_specification.rb
|
329
|
-
- lib/graphql/compatibility/query_parser_specification/parse_error_specification.rb
|
330
|
-
- lib/graphql/compatibility/query_parser_specification/query_assertions.rb
|
331
|
-
- lib/graphql/compatibility/schema_parser_specification.rb
|
332
309
|
- lib/graphql/dataloader.rb
|
333
310
|
- lib/graphql/dataloader/null_dataloader.rb
|
334
311
|
- lib/graphql/dataloader/request.rb
|
335
312
|
- lib/graphql/dataloader/request_all.rb
|
336
313
|
- lib/graphql/dataloader/source.rb
|
337
314
|
- lib/graphql/date_encoding_error.rb
|
338
|
-
- lib/graphql/define.rb
|
339
|
-
- lib/graphql/define/assign_argument.rb
|
340
|
-
- lib/graphql/define/assign_connection.rb
|
341
|
-
- lib/graphql/define/assign_enum_value.rb
|
342
|
-
- lib/graphql/define/assign_global_id_field.rb
|
343
|
-
- lib/graphql/define/assign_mutation_function.rb
|
344
|
-
- lib/graphql/define/assign_object_field.rb
|
345
|
-
- lib/graphql/define/defined_object_proxy.rb
|
346
|
-
- lib/graphql/define/instance_definable.rb
|
347
|
-
- lib/graphql/define/no_definition_error.rb
|
348
|
-
- lib/graphql/define/non_null_with_bang.rb
|
349
|
-
- lib/graphql/define/type_definer.rb
|
350
|
-
- lib/graphql/deprecated_dsl.rb
|
351
315
|
- lib/graphql/deprecation.rb
|
352
316
|
- lib/graphql/dig.rb
|
353
|
-
- lib/graphql/directive.rb
|
354
|
-
- lib/graphql/directive/deprecated_directive.rb
|
355
|
-
- lib/graphql/directive/include_directive.rb
|
356
|
-
- lib/graphql/directive/skip_directive.rb
|
357
|
-
- lib/graphql/enum_type.rb
|
358
317
|
- lib/graphql/execution.rb
|
359
318
|
- lib/graphql/execution/directive_checks.rb
|
360
319
|
- lib/graphql/execution/errors.rb
|
361
|
-
- lib/graphql/execution/execute.rb
|
362
|
-
- lib/graphql/execution/flatten.rb
|
363
|
-
- lib/graphql/execution/instrumentation.rb
|
364
320
|
- lib/graphql/execution/interpreter.rb
|
365
321
|
- lib/graphql/execution/interpreter/argument_value.rb
|
366
322
|
- lib/graphql/execution/interpreter/arguments.rb
|
@@ -371,29 +327,12 @@ files:
|
|
371
327
|
- lib/graphql/execution/interpreter/runtime.rb
|
372
328
|
- lib/graphql/execution/lazy.rb
|
373
329
|
- lib/graphql/execution/lazy/lazy_method_map.rb
|
374
|
-
- lib/graphql/execution/lazy/resolve.rb
|
375
330
|
- lib/graphql/execution/lookahead.rb
|
376
331
|
- lib/graphql/execution/multiplex.rb
|
377
|
-
- lib/graphql/execution/typecast.rb
|
378
332
|
- lib/graphql/execution_error.rb
|
379
|
-
- lib/graphql/field.rb
|
380
|
-
- lib/graphql/field/resolve.rb
|
381
333
|
- lib/graphql/filter.rb
|
382
|
-
- lib/graphql/float_type.rb
|
383
|
-
- lib/graphql/function.rb
|
384
|
-
- lib/graphql/id_type.rb
|
385
|
-
- lib/graphql/input_object_type.rb
|
386
|
-
- lib/graphql/int_type.rb
|
387
334
|
- lib/graphql/integer_decoding_error.rb
|
388
335
|
- lib/graphql/integer_encoding_error.rb
|
389
|
-
- lib/graphql/interface_type.rb
|
390
|
-
- lib/graphql/internal_representation.rb
|
391
|
-
- lib/graphql/internal_representation/document.rb
|
392
|
-
- lib/graphql/internal_representation/node.rb
|
393
|
-
- lib/graphql/internal_representation/print.rb
|
394
|
-
- lib/graphql/internal_representation/rewrite.rb
|
395
|
-
- lib/graphql/internal_representation/scope.rb
|
396
|
-
- lib/graphql/internal_representation/visit.rb
|
397
336
|
- lib/graphql/introspection.rb
|
398
337
|
- lib/graphql/introspection/base_object.rb
|
399
338
|
- lib/graphql/introspection/directive_location_enum.rb
|
@@ -416,7 +355,6 @@ files:
|
|
416
355
|
- lib/graphql/language/document_from_schema_definition.rb
|
417
356
|
- lib/graphql/language/generation.rb
|
418
357
|
- lib/graphql/language/lexer.rb
|
419
|
-
- lib/graphql/language/lexer.rl
|
420
358
|
- lib/graphql/language/nodes.rb
|
421
359
|
- lib/graphql/language/parser.rb
|
422
360
|
- lib/graphql/language/parser.y
|
@@ -424,11 +362,8 @@ files:
|
|
424
362
|
- lib/graphql/language/sanitized_printer.rb
|
425
363
|
- lib/graphql/language/token.rb
|
426
364
|
- lib/graphql/language/visitor.rb
|
427
|
-
- lib/graphql/list_type.rb
|
428
365
|
- lib/graphql/load_application_object_failed_error.rb
|
429
366
|
- lib/graphql/name_validator.rb
|
430
|
-
- lib/graphql/non_null_type.rb
|
431
|
-
- lib/graphql/object_type.rb
|
432
367
|
- lib/graphql/pagination.rb
|
433
368
|
- lib/graphql/pagination/active_record_relation_connection.rb
|
434
369
|
- lib/graphql/pagination/array_connection.rb
|
@@ -439,20 +374,11 @@ files:
|
|
439
374
|
- lib/graphql/pagination/sequel_dataset_connection.rb
|
440
375
|
- lib/graphql/parse_error.rb
|
441
376
|
- lib/graphql/query.rb
|
442
|
-
- lib/graphql/query/arguments.rb
|
443
|
-
- lib/graphql/query/arguments_cache.rb
|
444
377
|
- lib/graphql/query/context.rb
|
445
|
-
- lib/graphql/query/executor.rb
|
446
378
|
- lib/graphql/query/fingerprint.rb
|
447
379
|
- lib/graphql/query/input_validation_result.rb
|
448
|
-
- lib/graphql/query/literal_input.rb
|
449
380
|
- lib/graphql/query/null_context.rb
|
450
381
|
- lib/graphql/query/result.rb
|
451
|
-
- lib/graphql/query/serial_execution.rb
|
452
|
-
- lib/graphql/query/serial_execution/field_resolution.rb
|
453
|
-
- lib/graphql/query/serial_execution/operation_resolution.rb
|
454
|
-
- lib/graphql/query/serial_execution/selection_resolution.rb
|
455
|
-
- lib/graphql/query/serial_execution/value_resolution.rb
|
456
382
|
- lib/graphql/query/validation_pipeline.rb
|
457
383
|
- lib/graphql/query/variable_validation_error.rb
|
458
384
|
- lib/graphql/query/variables.rb
|
@@ -460,31 +386,12 @@ files:
|
|
460
386
|
- lib/graphql/rake_task.rb
|
461
387
|
- lib/graphql/rake_task/validate.rb
|
462
388
|
- lib/graphql/relay.rb
|
463
|
-
- lib/graphql/relay/array_connection.rb
|
464
|
-
- lib/graphql/relay/base_connection.rb
|
465
|
-
- lib/graphql/relay/connection_instrumentation.rb
|
466
|
-
- lib/graphql/relay/connection_resolve.rb
|
467
|
-
- lib/graphql/relay/connection_type.rb
|
468
|
-
- lib/graphql/relay/edge.rb
|
469
|
-
- lib/graphql/relay/edge_type.rb
|
470
|
-
- lib/graphql/relay/edges_instrumentation.rb
|
471
|
-
- lib/graphql/relay/global_id_resolve.rb
|
472
|
-
- lib/graphql/relay/mongo_relation_connection.rb
|
473
|
-
- lib/graphql/relay/mutation.rb
|
474
|
-
- lib/graphql/relay/mutation/instrumentation.rb
|
475
|
-
- lib/graphql/relay/mutation/resolve.rb
|
476
|
-
- lib/graphql/relay/mutation/result.rb
|
477
|
-
- lib/graphql/relay/node.rb
|
478
|
-
- lib/graphql/relay/page_info.rb
|
479
389
|
- lib/graphql/relay/range_add.rb
|
480
|
-
- lib/graphql/relay/relation_connection.rb
|
481
|
-
- lib/graphql/relay/type_extensions.rb
|
482
390
|
- lib/graphql/rubocop.rb
|
483
391
|
- lib/graphql/rubocop/graphql/base_cop.rb
|
484
392
|
- lib/graphql/rubocop/graphql/default_null_true.rb
|
485
393
|
- lib/graphql/rubocop/graphql/default_required_true.rb
|
486
394
|
- lib/graphql/runtime_type_error.rb
|
487
|
-
- lib/graphql/scalar_type.rb
|
488
395
|
- lib/graphql/schema.rb
|
489
396
|
- lib/graphql/schema/addition.rb
|
490
397
|
- lib/graphql/schema/argument.rb
|
@@ -494,14 +401,12 @@ files:
|
|
494
401
|
- lib/graphql/schema/build_from_definition/resolve_map.rb
|
495
402
|
- lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb
|
496
403
|
- lib/graphql/schema/built_in_types.rb
|
497
|
-
- lib/graphql/schema/catchall_middleware.rb
|
498
|
-
- lib/graphql/schema/default_parse_error.rb
|
499
|
-
- lib/graphql/schema/default_type_error.rb
|
500
404
|
- lib/graphql/schema/directive.rb
|
501
405
|
- lib/graphql/schema/directive/deprecated.rb
|
502
406
|
- lib/graphql/schema/directive/feature.rb
|
503
407
|
- lib/graphql/schema/directive/flagged.rb
|
504
408
|
- lib/graphql/schema/directive/include.rb
|
409
|
+
- lib/graphql/schema/directive/one_of.rb
|
505
410
|
- lib/graphql/schema/directive/skip.rb
|
506
411
|
- lib/graphql/schema/directive/transform.rb
|
507
412
|
- lib/graphql/schema/enum.rb
|
@@ -520,10 +425,8 @@ files:
|
|
520
425
|
- lib/graphql/schema/list.rb
|
521
426
|
- lib/graphql/schema/loader.rb
|
522
427
|
- lib/graphql/schema/member.rb
|
523
|
-
- lib/graphql/schema/member/accepts_definition.rb
|
524
428
|
- lib/graphql/schema/member/base_dsl_methods.rb
|
525
429
|
- lib/graphql/schema/member/build_type.rb
|
526
|
-
- lib/graphql/schema/member/cached_graphql_definition.rb
|
527
430
|
- lib/graphql/schema/member/graphql_type_names.rb
|
528
431
|
- lib/graphql/schema/member/has_arguments.rb
|
529
432
|
- lib/graphql/schema/member/has_ast_node.rb
|
@@ -534,32 +437,25 @@ files:
|
|
534
437
|
- lib/graphql/schema/member/has_path.rb
|
535
438
|
- lib/graphql/schema/member/has_unresolved_type_error.rb
|
536
439
|
- lib/graphql/schema/member/has_validators.rb
|
537
|
-
- lib/graphql/schema/member/instrumentation.rb
|
538
440
|
- lib/graphql/schema/member/relay_shortcuts.rb
|
539
441
|
- lib/graphql/schema/member/scoped.rb
|
540
442
|
- lib/graphql/schema/member/type_system_helpers.rb
|
541
443
|
- lib/graphql/schema/member/validates_input.rb
|
542
|
-
- lib/graphql/schema/middleware_chain.rb
|
543
444
|
- lib/graphql/schema/mutation.rb
|
544
445
|
- lib/graphql/schema/non_null.rb
|
545
446
|
- lib/graphql/schema/null_mask.rb
|
546
447
|
- lib/graphql/schema/object.rb
|
547
|
-
- lib/graphql/schema/possible_types.rb
|
548
448
|
- lib/graphql/schema/printer.rb
|
549
449
|
- lib/graphql/schema/relay_classic_mutation.rb
|
550
|
-
- lib/graphql/schema/rescue_middleware.rb
|
551
450
|
- lib/graphql/schema/resolver.rb
|
552
451
|
- lib/graphql/schema/resolver/has_payload_type.rb
|
553
452
|
- lib/graphql/schema/scalar.rb
|
554
453
|
- lib/graphql/schema/subscription.rb
|
555
454
|
- lib/graphql/schema/timeout.rb
|
556
|
-
- lib/graphql/schema/timeout_middleware.rb
|
557
|
-
- lib/graphql/schema/traversal.rb
|
558
455
|
- lib/graphql/schema/type_expression.rb
|
559
456
|
- lib/graphql/schema/type_membership.rb
|
560
457
|
- lib/graphql/schema/union.rb
|
561
458
|
- lib/graphql/schema/unique_within_type.rb
|
562
|
-
- lib/graphql/schema/validation.rb
|
563
459
|
- lib/graphql/schema/validator.rb
|
564
460
|
- lib/graphql/schema/validator/allow_blank_validator.rb
|
565
461
|
- lib/graphql/schema/validator/allow_null_validator.rb
|
@@ -574,12 +470,10 @@ files:
|
|
574
470
|
- lib/graphql/static_validation.rb
|
575
471
|
- lib/graphql/static_validation/all_rules.rb
|
576
472
|
- lib/graphql/static_validation/base_visitor.rb
|
577
|
-
- lib/graphql/static_validation/default_visitor.rb
|
578
473
|
- lib/graphql/static_validation/definition_dependencies.rb
|
579
474
|
- lib/graphql/static_validation/error.rb
|
580
475
|
- lib/graphql/static_validation/interpreter_visitor.rb
|
581
476
|
- lib/graphql/static_validation/literal_validator.rb
|
582
|
-
- lib/graphql/static_validation/no_validate_visitor.rb
|
583
477
|
- lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
|
584
478
|
- lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
|
585
479
|
- lib/graphql/static_validation/rules/argument_names_are_unique.rb
|
@@ -616,6 +510,8 @@ files:
|
|
616
510
|
- lib/graphql/static_validation/rules/mutation_root_exists_error.rb
|
617
511
|
- lib/graphql/static_validation/rules/no_definitions_are_present.rb
|
618
512
|
- lib/graphql/static_validation/rules/no_definitions_are_present_error.rb
|
513
|
+
- lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb
|
514
|
+
- lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb
|
619
515
|
- lib/graphql/static_validation/rules/operation_names_are_valid.rb
|
620
516
|
- lib/graphql/static_validation/rules/operation_names_are_valid_error.rb
|
621
517
|
- lib/graphql/static_validation/rules/query_root_exists.rb
|
@@ -643,7 +539,6 @@ files:
|
|
643
539
|
- lib/graphql/static_validation/validation_timeout_error.rb
|
644
540
|
- lib/graphql/static_validation/validator.rb
|
645
541
|
- lib/graphql/string_encoding_error.rb
|
646
|
-
- lib/graphql/string_type.rb
|
647
542
|
- lib/graphql/subscriptions.rb
|
648
543
|
- lib/graphql/subscriptions/action_cable_subscriptions.rb
|
649
544
|
- lib/graphql/subscriptions/broadcast_analyzer.rb
|
@@ -651,19 +546,27 @@ files:
|
|
651
546
|
- lib/graphql/subscriptions/event.rb
|
652
547
|
- lib/graphql/subscriptions/instrumentation.rb
|
653
548
|
- lib/graphql/subscriptions/serialize.rb
|
654
|
-
- lib/graphql/subscriptions/subscription_root.rb
|
655
549
|
- lib/graphql/tracing.rb
|
550
|
+
- lib/graphql/tracing/active_support_notifications_trace.rb
|
656
551
|
- lib/graphql/tracing/active_support_notifications_tracing.rb
|
552
|
+
- lib/graphql/tracing/appoptics_trace.rb
|
657
553
|
- lib/graphql/tracing/appoptics_tracing.rb
|
554
|
+
- lib/graphql/tracing/appsignal_trace.rb
|
658
555
|
- lib/graphql/tracing/appsignal_tracing.rb
|
556
|
+
- lib/graphql/tracing/data_dog_trace.rb
|
659
557
|
- lib/graphql/tracing/data_dog_tracing.rb
|
558
|
+
- lib/graphql/tracing/new_relic_trace.rb
|
660
559
|
- lib/graphql/tracing/new_relic_tracing.rb
|
560
|
+
- lib/graphql/tracing/notifications_trace.rb
|
661
561
|
- lib/graphql/tracing/notifications_tracing.rb
|
562
|
+
- lib/graphql/tracing/platform_trace.rb
|
662
563
|
- lib/graphql/tracing/platform_tracing.rb
|
564
|
+
- lib/graphql/tracing/prometheus_trace.rb
|
663
565
|
- lib/graphql/tracing/prometheus_tracing.rb
|
664
566
|
- lib/graphql/tracing/prometheus_tracing/graphql_collector.rb
|
567
|
+
- lib/graphql/tracing/scout_trace.rb
|
665
568
|
- lib/graphql/tracing/scout_tracing.rb
|
666
|
-
- lib/graphql/tracing/
|
569
|
+
- lib/graphql/tracing/statsd_trace.rb
|
667
570
|
- lib/graphql/tracing/statsd_tracing.rb
|
668
571
|
- lib/graphql/type_kinds.rb
|
669
572
|
- lib/graphql/types.rb
|
@@ -679,23 +582,17 @@ files:
|
|
679
582
|
- lib/graphql/types/relay/base_connection.rb
|
680
583
|
- lib/graphql/types/relay/base_edge.rb
|
681
584
|
- lib/graphql/types/relay/connection_behaviors.rb
|
682
|
-
- lib/graphql/types/relay/default_relay.rb
|
683
585
|
- lib/graphql/types/relay/edge_behaviors.rb
|
684
586
|
- lib/graphql/types/relay/has_node_field.rb
|
685
587
|
- lib/graphql/types/relay/has_nodes_field.rb
|
686
588
|
- lib/graphql/types/relay/node.rb
|
687
589
|
- lib/graphql/types/relay/node_behaviors.rb
|
688
|
-
- lib/graphql/types/relay/node_field.rb
|
689
|
-
- lib/graphql/types/relay/nodes_field.rb
|
690
590
|
- lib/graphql/types/relay/page_info.rb
|
691
591
|
- lib/graphql/types/relay/page_info_behaviors.rb
|
692
592
|
- lib/graphql/types/string.rb
|
693
593
|
- lib/graphql/unauthorized_error.rb
|
694
594
|
- lib/graphql/unauthorized_field_error.rb
|
695
|
-
- lib/graphql/union_type.rb
|
696
595
|
- lib/graphql/unresolved_type_error.rb
|
697
|
-
- lib/graphql/upgrader/member.rb
|
698
|
-
- lib/graphql/upgrader/schema.rb
|
699
596
|
- lib/graphql/version.rb
|
700
597
|
- readme.md
|
701
598
|
homepage: https://github.com/rmosolgo/graphql-ruby
|
@@ -722,7 +619,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
722
619
|
- !ruby/object:Gem::Version
|
723
620
|
version: '0'
|
724
621
|
requirements: []
|
725
|
-
rubygems_version: 3.
|
622
|
+
rubygems_version: 3.4.1
|
726
623
|
signing_key:
|
727
624
|
specification_version: 4
|
728
625
|
summary: A GraphQL language and runtime for Ruby
|
@@ -1,98 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module GraphQL
|
3
|
-
module Analysis
|
4
|
-
module_function
|
5
|
-
|
6
|
-
def use(schema_class)
|
7
|
-
schema = schema_class.is_a?(Class) ? schema_class : schema_class.target
|
8
|
-
schema.analysis_engine = self
|
9
|
-
end
|
10
|
-
|
11
|
-
# @return [void]
|
12
|
-
def analyze_multiplex(multiplex, analyzers)
|
13
|
-
multiplex.trace("analyze_multiplex", { multiplex: multiplex }) do
|
14
|
-
reducer_states = analyzers.map { |r| ReducerState.new(r, multiplex) }
|
15
|
-
query_results = multiplex.queries.map do |query|
|
16
|
-
if query.valid?
|
17
|
-
analyze_query(query, query.analyzers, multiplex_states: reducer_states)
|
18
|
-
else
|
19
|
-
[]
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
multiplex_results = reducer_states.map(&:finalize_reducer)
|
24
|
-
multiplex_errors = analysis_errors(multiplex_results)
|
25
|
-
|
26
|
-
multiplex.queries.each_with_index do |query, idx|
|
27
|
-
query.analysis_errors = multiplex_errors + analysis_errors(query_results[idx])
|
28
|
-
end
|
29
|
-
end
|
30
|
-
nil
|
31
|
-
end
|
32
|
-
|
33
|
-
# Visit `query`'s internal representation, calling `analyzers` along the way.
|
34
|
-
#
|
35
|
-
# - First, query analyzers are filtered down by calling `.analyze?(query)`, if they respond to that method
|
36
|
-
# - Then, query analyzers are initialized by calling `.initial_value(query)`, if they respond to that method.
|
37
|
-
# - Then, they receive `.call(memo, visit_type, irep_node)`, where visit type is `:enter` or `:leave`.
|
38
|
-
# - Last, they receive `.final_value(memo)`, if they respond to that method.
|
39
|
-
#
|
40
|
-
# It returns an array of final `memo` values in the order that `analyzers` were passed in.
|
41
|
-
#
|
42
|
-
# @param query [GraphQL::Query]
|
43
|
-
# @param analyzers [Array<#call>] Objects that respond to `#call(memo, visit_type, irep_node)`
|
44
|
-
# @return [Array<Any>] Results from those analyzers
|
45
|
-
def analyze_query(query, analyzers, multiplex_states: [])
|
46
|
-
GraphQL::Deprecation.warn "Legacy analysis will be removed in GraphQL-Ruby 2.0, please upgrade to AST Analysis: https://graphql-ruby.org/queries/ast_analysis.html (schema: #{query.schema})"
|
47
|
-
|
48
|
-
query.trace("analyze_query", { query: query }) do
|
49
|
-
analyzers_to_run = analyzers.select do |analyzer|
|
50
|
-
if analyzer.respond_to?(:analyze?)
|
51
|
-
analyzer.analyze?(query)
|
52
|
-
else
|
53
|
-
true
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
reducer_states = analyzers_to_run.map { |r| ReducerState.new(r, query) } + multiplex_states
|
58
|
-
|
59
|
-
irep = query.internal_representation
|
60
|
-
|
61
|
-
irep.operation_definitions.each do |name, op_node|
|
62
|
-
reduce_node(op_node, reducer_states)
|
63
|
-
end
|
64
|
-
|
65
|
-
reducer_states.map(&:finalize_reducer)
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
private
|
70
|
-
|
71
|
-
module_function
|
72
|
-
|
73
|
-
# Enter the node, visit its children, then leave the node.
|
74
|
-
def reduce_node(irep_node, reducer_states)
|
75
|
-
visit_analyzers(:enter, irep_node, reducer_states)
|
76
|
-
|
77
|
-
irep_node.typed_children.each do |type_defn, children|
|
78
|
-
children.each do |name, child_irep_node|
|
79
|
-
reduce_node(child_irep_node, reducer_states)
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
visit_analyzers(:leave, irep_node, reducer_states)
|
84
|
-
end
|
85
|
-
|
86
|
-
def visit_analyzers(visit_type, irep_node, reducer_states)
|
87
|
-
reducer_states.each do |reducer_state|
|
88
|
-
next_memo = reducer_state.call(visit_type, irep_node)
|
89
|
-
|
90
|
-
reducer_state.memo = next_memo
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
def analysis_errors(results)
|
95
|
-
results.flatten.select { |r| r.is_a?(GraphQL::AnalysisError) }
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module GraphQL
|
3
|
-
module Analysis
|
4
|
-
# A query reducer for tracking both field usage and deprecated field usage.
|
5
|
-
#
|
6
|
-
# @example Logging field usage and deprecated field usage
|
7
|
-
# Schema.query_analyzers << GraphQL::Analysis::FieldUsage.new { |query, used_fields, used_deprecated_fields|
|
8
|
-
# puts "Used GraphQL fields: #{used_fields.join(', ')}"
|
9
|
-
# puts "Used deprecated GraphQL fields: #{used_deprecated_fields.join(', ')}"
|
10
|
-
# }
|
11
|
-
# Schema.execute(query_str)
|
12
|
-
# # Used GraphQL fields: Cheese.id, Cheese.fatContent, Query.cheese
|
13
|
-
# # Used deprecated GraphQL fields: Cheese.fatContent
|
14
|
-
#
|
15
|
-
class FieldUsage
|
16
|
-
def initialize(&block)
|
17
|
-
@field_usage_handler = block
|
18
|
-
end
|
19
|
-
|
20
|
-
def initial_value(query)
|
21
|
-
{
|
22
|
-
query: query,
|
23
|
-
used_fields: Set.new,
|
24
|
-
used_deprecated_fields: Set.new
|
25
|
-
}
|
26
|
-
end
|
27
|
-
|
28
|
-
def call(memo, visit_type, irep_node)
|
29
|
-
if irep_node.ast_node.is_a?(GraphQL::Language::Nodes::Field) && visit_type == :leave
|
30
|
-
field = "#{irep_node.owner_type.name}.#{irep_node.definition.name}"
|
31
|
-
memo[:used_fields] << field
|
32
|
-
if irep_node.definition.deprecation_reason
|
33
|
-
memo[:used_deprecated_fields] << field
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
memo
|
38
|
-
end
|
39
|
-
|
40
|
-
def final_value(memo)
|
41
|
-
@field_usage_handler.call(memo[:query], memo[:used_fields].to_a, memo[:used_deprecated_fields].to_a)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|