graphql 2.2.17 → 2.5.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/install/mutation_root_generator.rb +2 -2
- data/lib/generators/graphql/install_generator.rb +46 -0
- data/lib/generators/graphql/orm_mutations_base.rb +1 -1
- data/lib/generators/graphql/templates/base_resolver.erb +2 -0
- data/lib/generators/graphql/templates/schema.erb +3 -0
- data/lib/generators/graphql/type_generator.rb +1 -1
- data/lib/graphql/analysis/analyzer.rb +90 -0
- data/lib/graphql/analysis/field_usage.rb +82 -0
- data/lib/graphql/analysis/max_query_complexity.rb +20 -0
- data/lib/graphql/analysis/max_query_depth.rb +20 -0
- data/lib/graphql/analysis/query_complexity.rb +263 -0
- data/lib/graphql/analysis/{ast/query_depth.rb → query_depth.rb} +23 -25
- data/lib/graphql/analysis/visitor.rb +280 -0
- data/lib/graphql/analysis.rb +95 -1
- data/lib/graphql/autoload.rb +38 -0
- data/lib/graphql/backtrace/table.rb +118 -55
- data/lib/graphql/backtrace.rb +1 -19
- data/lib/graphql/current.rb +57 -0
- data/lib/graphql/dashboard/detailed_traces.rb +47 -0
- data/lib/graphql/dashboard/installable.rb +22 -0
- data/lib/graphql/dashboard/limiters.rb +93 -0
- data/lib/graphql/dashboard/operation_store.rb +199 -0
- data/lib/graphql/dashboard/statics/bootstrap-5.3.3.min.css +6 -0
- data/lib/graphql/dashboard/statics/bootstrap-5.3.3.min.js +7 -0
- data/lib/graphql/dashboard/statics/charts.min.css +1 -0
- data/lib/graphql/dashboard/statics/dashboard.css +30 -0
- data/lib/graphql/dashboard/statics/dashboard.js +143 -0
- data/lib/graphql/dashboard/statics/header-icon.png +0 -0
- data/lib/graphql/dashboard/statics/icon.png +0 -0
- data/lib/graphql/dashboard/subscriptions.rb +96 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/detailed_traces/traces/index.html.erb +45 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/landings/show.html.erb +18 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/limiters/limiters/show.html.erb +62 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/not_installed.html.erb +18 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/_form.html.erb +23 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/edit.html.erb +21 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/index.html.erb +69 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/new.html.erb +7 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/index.html.erb +39 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/show.html.erb +32 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/index.html.erb +81 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/show.html.erb +71 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/subscriptions/show.html.erb +41 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/index.html.erb +55 -0
- data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/show.html.erb +40 -0
- data/lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb +108 -0
- data/lib/graphql/dashboard.rb +158 -0
- data/lib/graphql/dataloader/active_record_association_source.rb +84 -0
- data/lib/graphql/dataloader/active_record_source.rb +47 -0
- data/lib/graphql/dataloader/async_dataloader.rb +46 -19
- data/lib/graphql/dataloader/null_dataloader.rb +51 -10
- data/lib/graphql/dataloader/source.rb +20 -9
- data/lib/graphql/dataloader.rb +153 -45
- data/lib/graphql/date_encoding_error.rb +1 -1
- data/lib/graphql/dig.rb +2 -1
- data/lib/graphql/execution/interpreter/argument_value.rb +5 -1
- data/lib/graphql/execution/interpreter/arguments_cache.rb +5 -10
- data/lib/graphql/execution/interpreter/resolve.rb +23 -25
- data/lib/graphql/execution/interpreter/runtime/graphql_result.rb +63 -5
- data/lib/graphql/execution/interpreter/runtime.rb +321 -222
- data/lib/graphql/execution/interpreter.rb +23 -30
- data/lib/graphql/execution/lookahead.rb +18 -11
- data/lib/graphql/execution/multiplex.rb +6 -5
- data/lib/graphql/introspection/directive_location_enum.rb +1 -1
- data/lib/graphql/introspection/directive_type.rb +1 -1
- data/lib/graphql/introspection/entry_points.rb +2 -2
- data/lib/graphql/introspection/field_type.rb +1 -1
- data/lib/graphql/introspection/schema_type.rb +6 -11
- data/lib/graphql/introspection/type_type.rb +5 -5
- data/lib/graphql/invalid_name_error.rb +1 -1
- data/lib/graphql/invalid_null_error.rb +20 -17
- data/lib/graphql/language/cache.rb +13 -0
- data/lib/graphql/language/comment.rb +18 -0
- data/lib/graphql/language/document_from_schema_definition.rb +64 -35
- data/lib/graphql/language/lexer.rb +72 -42
- data/lib/graphql/language/nodes.rb +93 -52
- data/lib/graphql/language/parser.rb +168 -61
- data/lib/graphql/language/printer.rb +31 -15
- data/lib/graphql/language/sanitized_printer.rb +1 -1
- data/lib/graphql/language.rb +61 -1
- data/lib/graphql/pagination/connection.rb +1 -1
- data/lib/graphql/query/context/scoped_context.rb +1 -1
- data/lib/graphql/query/context.rb +46 -47
- data/lib/graphql/query/null_context.rb +3 -5
- data/lib/graphql/query/partial.rb +179 -0
- data/lib/graphql/query/validation_pipeline.rb +2 -2
- data/lib/graphql/query/variable_validation_error.rb +1 -1
- data/lib/graphql/query.rb +123 -69
- data/lib/graphql/railtie.rb +7 -0
- data/lib/graphql/rubocop/graphql/base_cop.rb +1 -1
- data/lib/graphql/rubocop/graphql/field_type_in_block.rb +144 -0
- data/lib/graphql/rubocop/graphql/root_types_in_block.rb +38 -0
- data/lib/graphql/rubocop.rb +2 -0
- data/lib/graphql/schema/addition.rb +26 -13
- data/lib/graphql/schema/always_visible.rb +7 -2
- data/lib/graphql/schema/argument.rb +57 -8
- data/lib/graphql/schema/build_from_definition.rb +116 -49
- data/lib/graphql/schema/directive/flagged.rb +4 -2
- data/lib/graphql/schema/directive.rb +54 -2
- data/lib/graphql/schema/enum.rb +107 -24
- data/lib/graphql/schema/enum_value.rb +10 -2
- data/lib/graphql/schema/field/connection_extension.rb +1 -1
- data/lib/graphql/schema/field/scope_extension.rb +1 -1
- data/lib/graphql/schema/field.rb +134 -45
- data/lib/graphql/schema/field_extension.rb +1 -1
- data/lib/graphql/schema/has_single_input_argument.rb +6 -2
- data/lib/graphql/schema/input_object.rb +122 -64
- data/lib/graphql/schema/interface.rb +23 -5
- data/lib/graphql/schema/introspection_system.rb +6 -17
- data/lib/graphql/schema/late_bound_type.rb +4 -0
- data/lib/graphql/schema/list.rb +3 -3
- data/lib/graphql/schema/loader.rb +3 -2
- data/lib/graphql/schema/member/base_dsl_methods.rb +15 -0
- data/lib/graphql/schema/member/has_arguments.rb +44 -58
- data/lib/graphql/schema/member/has_dataloader.rb +62 -0
- data/lib/graphql/schema/member/has_deprecation_reason.rb +15 -0
- data/lib/graphql/schema/member/has_directives.rb +4 -4
- data/lib/graphql/schema/member/has_fields.rb +26 -6
- data/lib/graphql/schema/member/has_interfaces.rb +6 -6
- data/lib/graphql/schema/member/has_unresolved_type_error.rb +5 -1
- data/lib/graphql/schema/member/has_validators.rb +1 -1
- data/lib/graphql/schema/member/relay_shortcuts.rb +1 -1
- data/lib/graphql/schema/member/type_system_helpers.rb +17 -4
- data/lib/graphql/schema/member.rb +1 -0
- data/lib/graphql/schema/mutation.rb +7 -0
- data/lib/graphql/schema/object.rb +25 -8
- data/lib/graphql/schema/printer.rb +1 -0
- data/lib/graphql/schema/ractor_shareable.rb +79 -0
- data/lib/graphql/schema/relay_classic_mutation.rb +0 -1
- data/lib/graphql/schema/resolver.rb +29 -23
- data/lib/graphql/schema/scalar.rb +1 -6
- data/lib/graphql/schema/subscription.rb +52 -6
- data/lib/graphql/schema/timeout.rb +19 -2
- data/lib/graphql/schema/type_expression.rb +2 -2
- data/lib/graphql/schema/union.rb +1 -1
- data/lib/graphql/schema/validator/all_validator.rb +62 -0
- data/lib/graphql/schema/validator/required_validator.rb +92 -11
- data/lib/graphql/schema/validator.rb +3 -1
- data/lib/graphql/schema/visibility/migration.rb +188 -0
- data/lib/graphql/schema/visibility/profile.rb +445 -0
- data/lib/graphql/schema/visibility/visit.rb +190 -0
- data/lib/graphql/schema/visibility.rb +311 -0
- data/lib/graphql/schema/warden.rb +190 -20
- data/lib/graphql/schema.rb +695 -167
- data/lib/graphql/static_validation/all_rules.rb +2 -2
- data/lib/graphql/static_validation/base_visitor.rb +6 -5
- data/lib/graphql/static_validation/literal_validator.rb +4 -4
- data/lib/graphql/static_validation/rules/argument_literals_are_compatible.rb +1 -1
- data/lib/graphql/static_validation/rules/argument_names_are_unique.rb +1 -1
- data/lib/graphql/static_validation/rules/arguments_are_defined.rb +3 -2
- data/lib/graphql/static_validation/rules/directives_are_defined.rb +3 -3
- data/lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb +2 -0
- data/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb +12 -2
- data/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb +47 -13
- data/lib/graphql/static_validation/rules/fields_will_merge.rb +88 -25
- data/lib/graphql/static_validation/rules/fields_will_merge_error.rb +10 -2
- data/lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb +3 -3
- data/lib/graphql/static_validation/rules/fragment_types_exist.rb +12 -2
- data/lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb +1 -1
- data/lib/graphql/static_validation/rules/mutation_root_exists.rb +1 -1
- data/lib/graphql/static_validation/rules/no_definitions_are_present.rb +1 -1
- data/lib/graphql/static_validation/rules/not_single_subscription_error.rb +25 -0
- data/lib/graphql/static_validation/rules/query_root_exists.rb +1 -1
- data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +4 -4
- data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb +3 -3
- data/lib/graphql/static_validation/rules/subscription_root_exists_and_single_subscription_selection.rb +26 -0
- data/lib/graphql/static_validation/rules/unique_directives_per_location.rb +7 -3
- data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb +18 -27
- data/lib/graphql/static_validation/rules/variable_names_are_unique.rb +1 -1
- data/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb +2 -2
- data/lib/graphql/static_validation/rules/variables_are_input_types.rb +11 -2
- data/lib/graphql/static_validation/validation_context.rb +18 -2
- data/lib/graphql/static_validation/validator.rb +6 -1
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +5 -3
- data/lib/graphql/subscriptions/broadcast_analyzer.rb +11 -5
- data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +12 -10
- data/lib/graphql/subscriptions/event.rb +13 -2
- data/lib/graphql/subscriptions/serialize.rb +1 -1
- data/lib/graphql/subscriptions.rb +7 -5
- data/lib/graphql/testing/helpers.rb +48 -16
- data/lib/graphql/testing/mock_action_cable.rb +111 -0
- data/lib/graphql/testing.rb +1 -0
- data/lib/graphql/tracing/active_support_notifications_trace.rb +14 -3
- data/lib/graphql/tracing/active_support_notifications_tracing.rb +1 -1
- data/lib/graphql/tracing/appoptics_trace.rb +5 -1
- data/lib/graphql/tracing/appoptics_tracing.rb +7 -0
- data/lib/graphql/tracing/appsignal_trace.rb +32 -59
- data/lib/graphql/tracing/appsignal_tracing.rb +2 -0
- data/lib/graphql/tracing/call_legacy_tracers.rb +66 -0
- data/lib/graphql/tracing/data_dog_trace.rb +46 -162
- data/lib/graphql/tracing/data_dog_tracing.rb +2 -0
- data/lib/graphql/tracing/detailed_trace/memory_backend.rb +60 -0
- data/lib/graphql/tracing/detailed_trace/redis_backend.rb +72 -0
- data/lib/graphql/tracing/detailed_trace.rb +141 -0
- data/lib/graphql/tracing/legacy_hooks_trace.rb +1 -0
- data/lib/graphql/tracing/legacy_trace.rb +4 -61
- data/lib/graphql/tracing/monitor_trace.rb +283 -0
- data/lib/graphql/tracing/new_relic_trace.rb +47 -54
- data/lib/graphql/tracing/new_relic_tracing.rb +2 -0
- data/lib/graphql/tracing/notifications_trace.rb +183 -37
- data/lib/graphql/tracing/notifications_tracing.rb +2 -0
- data/lib/graphql/tracing/null_trace.rb +9 -0
- data/lib/graphql/tracing/perfetto_trace/trace.proto +141 -0
- data/lib/graphql/tracing/perfetto_trace/trace_pb.rb +33 -0
- data/lib/graphql/tracing/perfetto_trace.rb +818 -0
- data/lib/graphql/tracing/platform_tracing.rb +1 -1
- data/lib/graphql/tracing/prometheus_trace/graphql_collector.rb +2 -0
- data/lib/graphql/tracing/prometheus_trace.rb +73 -73
- data/lib/graphql/tracing/prometheus_tracing.rb +2 -0
- data/lib/graphql/tracing/scout_trace.rb +32 -58
- data/lib/graphql/tracing/scout_tracing.rb +2 -0
- data/lib/graphql/tracing/sentry_trace.rb +64 -98
- data/lib/graphql/tracing/statsd_trace.rb +33 -45
- data/lib/graphql/tracing/statsd_tracing.rb +2 -0
- data/lib/graphql/tracing/trace.rb +111 -1
- data/lib/graphql/tracing.rb +31 -30
- data/lib/graphql/type_kinds.rb +2 -1
- data/lib/graphql/types/relay/connection_behaviors.rb +12 -2
- data/lib/graphql/types/relay/edge_behaviors.rb +11 -1
- data/lib/graphql/types/relay/page_info_behaviors.rb +4 -0
- data/lib/graphql/types.rb +18 -11
- data/lib/graphql/unauthorized_enum_value_error.rb +13 -0
- data/lib/graphql/version.rb +1 -1
- data/lib/graphql.rb +64 -54
- metadata +197 -22
- data/lib/graphql/analysis/ast/analyzer.rb +0 -91
- data/lib/graphql/analysis/ast/field_usage.rb +0 -82
- data/lib/graphql/analysis/ast/max_query_complexity.rb +0 -22
- data/lib/graphql/analysis/ast/max_query_depth.rb +0 -22
- data/lib/graphql/analysis/ast/query_complexity.rb +0 -182
- data/lib/graphql/analysis/ast/visitor.rb +0 -276
- data/lib/graphql/analysis/ast.rb +0 -94
- data/lib/graphql/backtrace/inspect_result.rb +0 -50
- data/lib/graphql/backtrace/trace.rb +0 -93
- data/lib/graphql/backtrace/tracer.rb +0 -80
- data/lib/graphql/language/token.rb +0 -34
- data/lib/graphql/schema/invalid_type_error.rb +0 -7
- data/lib/graphql/schema/null_mask.rb +0 -11
- data/lib/graphql/static_validation/rules/subscription_root_exists.rb +0 -17
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: graphql
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.5.16
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Mosolgo
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2025-
|
|
10
|
+
date: 2025-12-10 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: base64
|
|
@@ -23,6 +23,34 @@ dependencies:
|
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
25
|
version: '0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: fiber-storage
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: logger
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
26
54
|
- !ruby/object:Gem::Dependency
|
|
27
55
|
name: benchmark-ips
|
|
28
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -51,6 +79,20 @@ dependencies:
|
|
|
51
79
|
- - "~>"
|
|
52
80
|
- !ruby/object:Gem::Version
|
|
53
81
|
version: '1.0'
|
|
82
|
+
- !ruby/object:Gem::Dependency
|
|
83
|
+
name: google-protobuf
|
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - ">="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '0'
|
|
89
|
+
type: :development
|
|
90
|
+
prerelease: false
|
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - ">="
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: '0'
|
|
54
96
|
- !ruby/object:Gem::Dependency
|
|
55
97
|
name: graphql-batch
|
|
56
98
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -121,6 +163,20 @@ dependencies:
|
|
|
121
163
|
- - ">="
|
|
122
164
|
- !ruby/object:Gem::Version
|
|
123
165
|
version: '0'
|
|
166
|
+
- !ruby/object:Gem::Dependency
|
|
167
|
+
name: ostruct
|
|
168
|
+
requirement: !ruby/object:Gem::Requirement
|
|
169
|
+
requirements:
|
|
170
|
+
- - ">="
|
|
171
|
+
- !ruby/object:Gem::Version
|
|
172
|
+
version: '0'
|
|
173
|
+
type: :development
|
|
174
|
+
prerelease: false
|
|
175
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
176
|
+
requirements:
|
|
177
|
+
- - ">="
|
|
178
|
+
- !ruby/object:Gem::Version
|
|
179
|
+
version: '0'
|
|
124
180
|
- !ruby/object:Gem::Dependency
|
|
125
181
|
name: rake
|
|
126
182
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -153,16 +209,58 @@ dependencies:
|
|
|
153
209
|
name: rubocop
|
|
154
210
|
requirement: !ruby/object:Gem::Requirement
|
|
155
211
|
requirements:
|
|
156
|
-
- -
|
|
212
|
+
- - ">="
|
|
157
213
|
- !ruby/object:Gem::Version
|
|
158
|
-
version: '
|
|
214
|
+
version: '0'
|
|
159
215
|
type: :development
|
|
160
216
|
prerelease: false
|
|
161
217
|
version_requirements: !ruby/object:Gem::Requirement
|
|
162
218
|
requirements:
|
|
163
|
-
- -
|
|
219
|
+
- - ">="
|
|
164
220
|
- !ruby/object:Gem::Version
|
|
165
|
-
version: '
|
|
221
|
+
version: '0'
|
|
222
|
+
- !ruby/object:Gem::Dependency
|
|
223
|
+
name: simplecov
|
|
224
|
+
requirement: !ruby/object:Gem::Requirement
|
|
225
|
+
requirements:
|
|
226
|
+
- - ">="
|
|
227
|
+
- !ruby/object:Gem::Version
|
|
228
|
+
version: '0'
|
|
229
|
+
type: :development
|
|
230
|
+
prerelease: false
|
|
231
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
232
|
+
requirements:
|
|
233
|
+
- - ">="
|
|
234
|
+
- !ruby/object:Gem::Version
|
|
235
|
+
version: '0'
|
|
236
|
+
- !ruby/object:Gem::Dependency
|
|
237
|
+
name: simplecov-lcov
|
|
238
|
+
requirement: !ruby/object:Gem::Requirement
|
|
239
|
+
requirements:
|
|
240
|
+
- - ">="
|
|
241
|
+
- !ruby/object:Gem::Version
|
|
242
|
+
version: '0'
|
|
243
|
+
type: :development
|
|
244
|
+
prerelease: false
|
|
245
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
246
|
+
requirements:
|
|
247
|
+
- - ">="
|
|
248
|
+
- !ruby/object:Gem::Version
|
|
249
|
+
version: '0'
|
|
250
|
+
- !ruby/object:Gem::Dependency
|
|
251
|
+
name: undercover
|
|
252
|
+
requirement: !ruby/object:Gem::Requirement
|
|
253
|
+
requirements:
|
|
254
|
+
- - ">="
|
|
255
|
+
- !ruby/object:Gem::Version
|
|
256
|
+
version: '0'
|
|
257
|
+
type: :development
|
|
258
|
+
prerelease: false
|
|
259
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
260
|
+
requirements:
|
|
261
|
+
- - ">="
|
|
262
|
+
- !ruby/object:Gem::Version
|
|
263
|
+
version: '0'
|
|
166
264
|
- !ruby/object:Gem::Dependency
|
|
167
265
|
name: jekyll
|
|
168
266
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -177,6 +275,20 @@ dependencies:
|
|
|
177
275
|
- - ">="
|
|
178
276
|
- !ruby/object:Gem::Version
|
|
179
277
|
version: '0'
|
|
278
|
+
- !ruby/object:Gem::Dependency
|
|
279
|
+
name: jekyll-sass-converter
|
|
280
|
+
requirement: !ruby/object:Gem::Requirement
|
|
281
|
+
requirements:
|
|
282
|
+
- - "~>"
|
|
283
|
+
- !ruby/object:Gem::Version
|
|
284
|
+
version: '2.2'
|
|
285
|
+
type: :development
|
|
286
|
+
prerelease: false
|
|
287
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
288
|
+
requirements:
|
|
289
|
+
- - "~>"
|
|
290
|
+
- !ruby/object:Gem::Version
|
|
291
|
+
version: '2.2'
|
|
180
292
|
- !ruby/object:Gem::Dependency
|
|
181
293
|
name: yard
|
|
182
294
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -233,6 +345,20 @@ dependencies:
|
|
|
233
345
|
- - "~>"
|
|
234
346
|
- !ruby/object:Gem::Version
|
|
235
347
|
version: 1.5.0
|
|
348
|
+
- !ruby/object:Gem::Dependency
|
|
349
|
+
name: mutex_m
|
|
350
|
+
requirement: !ruby/object:Gem::Requirement
|
|
351
|
+
requirements:
|
|
352
|
+
- - ">="
|
|
353
|
+
- !ruby/object:Gem::Version
|
|
354
|
+
version: '0'
|
|
355
|
+
type: :development
|
|
356
|
+
prerelease: false
|
|
357
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
358
|
+
requirements:
|
|
359
|
+
- - ">="
|
|
360
|
+
- !ruby/object:Gem::Version
|
|
361
|
+
version: '0'
|
|
236
362
|
- !ruby/object:Gem::Dependency
|
|
237
363
|
name: webrick
|
|
238
364
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -305,23 +431,52 @@ files:
|
|
|
305
431
|
- lib/generators/graphql/union_generator.rb
|
|
306
432
|
- lib/graphql.rb
|
|
307
433
|
- lib/graphql/analysis.rb
|
|
308
|
-
- lib/graphql/analysis/
|
|
309
|
-
- lib/graphql/analysis/
|
|
310
|
-
- lib/graphql/analysis/
|
|
311
|
-
- lib/graphql/analysis/
|
|
312
|
-
- lib/graphql/analysis/
|
|
313
|
-
- lib/graphql/analysis/
|
|
314
|
-
- lib/graphql/analysis/
|
|
315
|
-
- lib/graphql/analysis/ast/visitor.rb
|
|
434
|
+
- lib/graphql/analysis/analyzer.rb
|
|
435
|
+
- lib/graphql/analysis/field_usage.rb
|
|
436
|
+
- lib/graphql/analysis/max_query_complexity.rb
|
|
437
|
+
- lib/graphql/analysis/max_query_depth.rb
|
|
438
|
+
- lib/graphql/analysis/query_complexity.rb
|
|
439
|
+
- lib/graphql/analysis/query_depth.rb
|
|
440
|
+
- lib/graphql/analysis/visitor.rb
|
|
316
441
|
- lib/graphql/analysis_error.rb
|
|
442
|
+
- lib/graphql/autoload.rb
|
|
317
443
|
- lib/graphql/backtrace.rb
|
|
318
|
-
- lib/graphql/backtrace/inspect_result.rb
|
|
319
444
|
- lib/graphql/backtrace/table.rb
|
|
320
|
-
- lib/graphql/backtrace/trace.rb
|
|
321
445
|
- lib/graphql/backtrace/traced_error.rb
|
|
322
|
-
- lib/graphql/backtrace/tracer.rb
|
|
323
446
|
- lib/graphql/coercion_error.rb
|
|
447
|
+
- lib/graphql/current.rb
|
|
448
|
+
- lib/graphql/dashboard.rb
|
|
449
|
+
- lib/graphql/dashboard/detailed_traces.rb
|
|
450
|
+
- lib/graphql/dashboard/installable.rb
|
|
451
|
+
- lib/graphql/dashboard/limiters.rb
|
|
452
|
+
- lib/graphql/dashboard/operation_store.rb
|
|
453
|
+
- lib/graphql/dashboard/statics/bootstrap-5.3.3.min.css
|
|
454
|
+
- lib/graphql/dashboard/statics/bootstrap-5.3.3.min.js
|
|
455
|
+
- lib/graphql/dashboard/statics/charts.min.css
|
|
456
|
+
- lib/graphql/dashboard/statics/dashboard.css
|
|
457
|
+
- lib/graphql/dashboard/statics/dashboard.js
|
|
458
|
+
- lib/graphql/dashboard/statics/header-icon.png
|
|
459
|
+
- lib/graphql/dashboard/statics/icon.png
|
|
460
|
+
- lib/graphql/dashboard/subscriptions.rb
|
|
461
|
+
- lib/graphql/dashboard/views/graphql/dashboard/detailed_traces/traces/index.html.erb
|
|
462
|
+
- lib/graphql/dashboard/views/graphql/dashboard/landings/show.html.erb
|
|
463
|
+
- lib/graphql/dashboard/views/graphql/dashboard/limiters/limiters/show.html.erb
|
|
464
|
+
- lib/graphql/dashboard/views/graphql/dashboard/not_installed.html.erb
|
|
465
|
+
- lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/_form.html.erb
|
|
466
|
+
- lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/edit.html.erb
|
|
467
|
+
- lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/index.html.erb
|
|
468
|
+
- lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/new.html.erb
|
|
469
|
+
- lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/index.html.erb
|
|
470
|
+
- lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/show.html.erb
|
|
471
|
+
- lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/index.html.erb
|
|
472
|
+
- lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/show.html.erb
|
|
473
|
+
- lib/graphql/dashboard/views/graphql/dashboard/subscriptions/subscriptions/show.html.erb
|
|
474
|
+
- lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/index.html.erb
|
|
475
|
+
- lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/show.html.erb
|
|
476
|
+
- lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb
|
|
324
477
|
- lib/graphql/dataloader.rb
|
|
478
|
+
- lib/graphql/dataloader/active_record_association_source.rb
|
|
479
|
+
- lib/graphql/dataloader/active_record_source.rb
|
|
325
480
|
- lib/graphql/dataloader/async_dataloader.rb
|
|
326
481
|
- lib/graphql/dataloader/null_dataloader.rb
|
|
327
482
|
- lib/graphql/dataloader/request.rb
|
|
@@ -367,6 +522,7 @@ files:
|
|
|
367
522
|
- lib/graphql/language.rb
|
|
368
523
|
- lib/graphql/language/block_string.rb
|
|
369
524
|
- lib/graphql/language/cache.rb
|
|
525
|
+
- lib/graphql/language/comment.rb
|
|
370
526
|
- lib/graphql/language/definition_slice.rb
|
|
371
527
|
- lib/graphql/language/document_from_schema_definition.rb
|
|
372
528
|
- lib/graphql/language/generation.rb
|
|
@@ -376,7 +532,6 @@ files:
|
|
|
376
532
|
- lib/graphql/language/printer.rb
|
|
377
533
|
- lib/graphql/language/sanitized_printer.rb
|
|
378
534
|
- lib/graphql/language/static_visitor.rb
|
|
379
|
-
- lib/graphql/language/token.rb
|
|
380
535
|
- lib/graphql/language/visitor.rb
|
|
381
536
|
- lib/graphql/load_application_object_failed_error.rb
|
|
382
537
|
- lib/graphql/name_validator.rb
|
|
@@ -395,6 +550,7 @@ files:
|
|
|
395
550
|
- lib/graphql/query/fingerprint.rb
|
|
396
551
|
- lib/graphql/query/input_validation_result.rb
|
|
397
552
|
- lib/graphql/query/null_context.rb
|
|
553
|
+
- lib/graphql/query/partial.rb
|
|
398
554
|
- lib/graphql/query/result.rb
|
|
399
555
|
- lib/graphql/query/validation_pipeline.rb
|
|
400
556
|
- lib/graphql/query/variable_validation_error.rb
|
|
@@ -408,6 +564,8 @@ files:
|
|
|
408
564
|
- lib/graphql/rubocop/graphql/base_cop.rb
|
|
409
565
|
- lib/graphql/rubocop/graphql/default_null_true.rb
|
|
410
566
|
- lib/graphql/rubocop/graphql/default_required_true.rb
|
|
567
|
+
- lib/graphql/rubocop/graphql/field_type_in_block.rb
|
|
568
|
+
- lib/graphql/rubocop/graphql/root_types_in_block.rb
|
|
411
569
|
- lib/graphql/runtime_type_error.rb
|
|
412
570
|
- lib/graphql/schema.rb
|
|
413
571
|
- lib/graphql/schema/addition.rb
|
|
@@ -439,7 +597,6 @@ files:
|
|
|
439
597
|
- lib/graphql/schema/input_object.rb
|
|
440
598
|
- lib/graphql/schema/interface.rb
|
|
441
599
|
- lib/graphql/schema/introspection_system.rb
|
|
442
|
-
- lib/graphql/schema/invalid_type_error.rb
|
|
443
600
|
- lib/graphql/schema/late_bound_type.rb
|
|
444
601
|
- lib/graphql/schema/list.rb
|
|
445
602
|
- lib/graphql/schema/loader.rb
|
|
@@ -449,6 +606,7 @@ files:
|
|
|
449
606
|
- lib/graphql/schema/member/graphql_type_names.rb
|
|
450
607
|
- lib/graphql/schema/member/has_arguments.rb
|
|
451
608
|
- lib/graphql/schema/member/has_ast_node.rb
|
|
609
|
+
- lib/graphql/schema/member/has_dataloader.rb
|
|
452
610
|
- lib/graphql/schema/member/has_deprecation_reason.rb
|
|
453
611
|
- lib/graphql/schema/member/has_directives.rb
|
|
454
612
|
- lib/graphql/schema/member/has_fields.rb
|
|
@@ -462,9 +620,9 @@ files:
|
|
|
462
620
|
- lib/graphql/schema/member/validates_input.rb
|
|
463
621
|
- lib/graphql/schema/mutation.rb
|
|
464
622
|
- lib/graphql/schema/non_null.rb
|
|
465
|
-
- lib/graphql/schema/null_mask.rb
|
|
466
623
|
- lib/graphql/schema/object.rb
|
|
467
624
|
- lib/graphql/schema/printer.rb
|
|
625
|
+
- lib/graphql/schema/ractor_shareable.rb
|
|
468
626
|
- lib/graphql/schema/relay_classic_mutation.rb
|
|
469
627
|
- lib/graphql/schema/resolver.rb
|
|
470
628
|
- lib/graphql/schema/resolver/has_payload_type.rb
|
|
@@ -476,6 +634,7 @@ files:
|
|
|
476
634
|
- lib/graphql/schema/union.rb
|
|
477
635
|
- lib/graphql/schema/unique_within_type.rb
|
|
478
636
|
- lib/graphql/schema/validator.rb
|
|
637
|
+
- lib/graphql/schema/validator/all_validator.rb
|
|
479
638
|
- lib/graphql/schema/validator/allow_blank_validator.rb
|
|
480
639
|
- lib/graphql/schema/validator/allow_null_validator.rb
|
|
481
640
|
- lib/graphql/schema/validator/exclusion_validator.rb
|
|
@@ -484,6 +643,10 @@ files:
|
|
|
484
643
|
- lib/graphql/schema/validator/length_validator.rb
|
|
485
644
|
- lib/graphql/schema/validator/numericality_validator.rb
|
|
486
645
|
- lib/graphql/schema/validator/required_validator.rb
|
|
646
|
+
- lib/graphql/schema/visibility.rb
|
|
647
|
+
- lib/graphql/schema/visibility/migration.rb
|
|
648
|
+
- lib/graphql/schema/visibility/profile.rb
|
|
649
|
+
- lib/graphql/schema/visibility/visit.rb
|
|
487
650
|
- lib/graphql/schema/warden.rb
|
|
488
651
|
- lib/graphql/schema/wrapper.rb
|
|
489
652
|
- lib/graphql/static_validation.rb
|
|
@@ -529,6 +692,7 @@ files:
|
|
|
529
692
|
- lib/graphql/static_validation/rules/mutation_root_exists_error.rb
|
|
530
693
|
- lib/graphql/static_validation/rules/no_definitions_are_present.rb
|
|
531
694
|
- lib/graphql/static_validation/rules/no_definitions_are_present_error.rb
|
|
695
|
+
- lib/graphql/static_validation/rules/not_single_subscription_error.rb
|
|
532
696
|
- lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb
|
|
533
697
|
- lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb
|
|
534
698
|
- lib/graphql/static_validation/rules/operation_names_are_valid.rb
|
|
@@ -539,7 +703,7 @@ files:
|
|
|
539
703
|
- lib/graphql/static_validation/rules/required_arguments_are_present_error.rb
|
|
540
704
|
- lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb
|
|
541
705
|
- lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb
|
|
542
|
-
- lib/graphql/static_validation/rules/
|
|
706
|
+
- lib/graphql/static_validation/rules/subscription_root_exists_and_single_subscription_selection.rb
|
|
543
707
|
- lib/graphql/static_validation/rules/subscription_root_exists_error.rb
|
|
544
708
|
- lib/graphql/static_validation/rules/unique_directives_per_location.rb
|
|
545
709
|
- lib/graphql/static_validation/rules/unique_directives_per_location_error.rb
|
|
@@ -565,6 +729,7 @@ files:
|
|
|
565
729
|
- lib/graphql/subscriptions/serialize.rb
|
|
566
730
|
- lib/graphql/testing.rb
|
|
567
731
|
- lib/graphql/testing/helpers.rb
|
|
732
|
+
- lib/graphql/testing/mock_action_cable.rb
|
|
568
733
|
- lib/graphql/tracing.rb
|
|
569
734
|
- lib/graphql/tracing/active_support_notifications_trace.rb
|
|
570
735
|
- lib/graphql/tracing/active_support_notifications_tracing.rb
|
|
@@ -572,14 +737,23 @@ files:
|
|
|
572
737
|
- lib/graphql/tracing/appoptics_tracing.rb
|
|
573
738
|
- lib/graphql/tracing/appsignal_trace.rb
|
|
574
739
|
- lib/graphql/tracing/appsignal_tracing.rb
|
|
740
|
+
- lib/graphql/tracing/call_legacy_tracers.rb
|
|
575
741
|
- lib/graphql/tracing/data_dog_trace.rb
|
|
576
742
|
- lib/graphql/tracing/data_dog_tracing.rb
|
|
743
|
+
- lib/graphql/tracing/detailed_trace.rb
|
|
744
|
+
- lib/graphql/tracing/detailed_trace/memory_backend.rb
|
|
745
|
+
- lib/graphql/tracing/detailed_trace/redis_backend.rb
|
|
577
746
|
- lib/graphql/tracing/legacy_hooks_trace.rb
|
|
578
747
|
- lib/graphql/tracing/legacy_trace.rb
|
|
748
|
+
- lib/graphql/tracing/monitor_trace.rb
|
|
579
749
|
- lib/graphql/tracing/new_relic_trace.rb
|
|
580
750
|
- lib/graphql/tracing/new_relic_tracing.rb
|
|
581
751
|
- lib/graphql/tracing/notifications_trace.rb
|
|
582
752
|
- lib/graphql/tracing/notifications_tracing.rb
|
|
753
|
+
- lib/graphql/tracing/null_trace.rb
|
|
754
|
+
- lib/graphql/tracing/perfetto_trace.rb
|
|
755
|
+
- lib/graphql/tracing/perfetto_trace/trace.proto
|
|
756
|
+
- lib/graphql/tracing/perfetto_trace/trace_pb.rb
|
|
583
757
|
- lib/graphql/tracing/platform_trace.rb
|
|
584
758
|
- lib/graphql/tracing/platform_tracing.rb
|
|
585
759
|
- lib/graphql/tracing/prometheus_trace.rb
|
|
@@ -614,6 +788,7 @@ files:
|
|
|
614
788
|
- lib/graphql/types/relay/page_info.rb
|
|
615
789
|
- lib/graphql/types/relay/page_info_behaviors.rb
|
|
616
790
|
- lib/graphql/types/string.rb
|
|
791
|
+
- lib/graphql/unauthorized_enum_value_error.rb
|
|
617
792
|
- lib/graphql/unauthorized_error.rb
|
|
618
793
|
- lib/graphql/unauthorized_field_error.rb
|
|
619
794
|
- lib/graphql/unresolved_type_error.rb
|
|
@@ -643,7 +818,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
643
818
|
- !ruby/object:Gem::Version
|
|
644
819
|
version: '0'
|
|
645
820
|
requirements: []
|
|
646
|
-
rubygems_version: 3.6.
|
|
821
|
+
rubygems_version: 3.6.2
|
|
647
822
|
specification_version: 4
|
|
648
823
|
summary: A GraphQL language and runtime for Ruby
|
|
649
824
|
test_files: []
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
module GraphQL
|
|
3
|
-
module Analysis
|
|
4
|
-
module AST
|
|
5
|
-
# Query analyzer for query ASTs. Query analyzers respond to visitor style methods
|
|
6
|
-
# but are prefixed by `enter` and `leave`.
|
|
7
|
-
#
|
|
8
|
-
# When an analyzer is initialized with a Multiplex, you can always get the current query from
|
|
9
|
-
# `visitor.query` in the visit methods.
|
|
10
|
-
#
|
|
11
|
-
# @param [GraphQL::Query, GraphQL::Execution::Multiplex] The query or multiplex to analyze
|
|
12
|
-
class Analyzer
|
|
13
|
-
def initialize(subject)
|
|
14
|
-
@subject = subject
|
|
15
|
-
|
|
16
|
-
if subject.is_a?(GraphQL::Query)
|
|
17
|
-
@query = subject
|
|
18
|
-
@multiplex = nil
|
|
19
|
-
else
|
|
20
|
-
@multiplex = subject
|
|
21
|
-
@query = nil
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# Analyzer hook to decide at analysis time whether a query should
|
|
26
|
-
# be analyzed or not.
|
|
27
|
-
# @return [Boolean] If the query should be analyzed or not
|
|
28
|
-
def analyze?
|
|
29
|
-
true
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
# Analyzer hook to decide at analysis time whether analysis
|
|
33
|
-
# requires a visitor pass; can be disabled for precomputed results.
|
|
34
|
-
# @return [Boolean] If analysis requires visitation or not
|
|
35
|
-
def visit?
|
|
36
|
-
true
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
# The result for this analyzer. Returning {GraphQL::AnalysisError} results
|
|
40
|
-
# in a query error.
|
|
41
|
-
# @return [Any] The analyzer result
|
|
42
|
-
def result
|
|
43
|
-
raise GraphQL::RequiredImplementationMissingError
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
class << self
|
|
47
|
-
private
|
|
48
|
-
|
|
49
|
-
def build_visitor_hooks(member_name)
|
|
50
|
-
class_eval(<<-EOS, __FILE__, __LINE__ + 1)
|
|
51
|
-
def on_enter_#{member_name}(node, parent, visitor)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def on_leave_#{member_name}(node, parent, visitor)
|
|
55
|
-
end
|
|
56
|
-
EOS
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
build_visitor_hooks :argument
|
|
61
|
-
build_visitor_hooks :directive
|
|
62
|
-
build_visitor_hooks :document
|
|
63
|
-
build_visitor_hooks :enum
|
|
64
|
-
build_visitor_hooks :field
|
|
65
|
-
build_visitor_hooks :fragment_spread
|
|
66
|
-
build_visitor_hooks :inline_fragment
|
|
67
|
-
build_visitor_hooks :input_object
|
|
68
|
-
build_visitor_hooks :list_type
|
|
69
|
-
build_visitor_hooks :non_null_type
|
|
70
|
-
build_visitor_hooks :null_value
|
|
71
|
-
build_visitor_hooks :operation_definition
|
|
72
|
-
build_visitor_hooks :type_name
|
|
73
|
-
build_visitor_hooks :variable_definition
|
|
74
|
-
build_visitor_hooks :variable_identifier
|
|
75
|
-
build_visitor_hooks :abstract_node
|
|
76
|
-
|
|
77
|
-
protected
|
|
78
|
-
|
|
79
|
-
# @return [GraphQL::Query, GraphQL::Execution::Multiplex] Whatever this analyzer is analyzing
|
|
80
|
-
attr_reader :subject
|
|
81
|
-
|
|
82
|
-
# @return [GraphQL::Query, nil] `nil` if this analyzer is visiting a multiplex
|
|
83
|
-
# (When this is `nil`, use `visitor.query` inside visit methods to get the current query)
|
|
84
|
-
attr_reader :query
|
|
85
|
-
|
|
86
|
-
# @return [GraphQL::Execution::Multiplex, nil] `nil` if this analyzer is visiting a query
|
|
87
|
-
attr_reader :multiplex
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
end
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
module GraphQL
|
|
3
|
-
module Analysis
|
|
4
|
-
module AST
|
|
5
|
-
class FieldUsage < Analyzer
|
|
6
|
-
def initialize(query)
|
|
7
|
-
super
|
|
8
|
-
@used_fields = Set.new
|
|
9
|
-
@used_deprecated_fields = Set.new
|
|
10
|
-
@used_deprecated_arguments = Set.new
|
|
11
|
-
@used_deprecated_enum_values = Set.new
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def on_leave_field(node, parent, visitor)
|
|
15
|
-
field_defn = visitor.field_definition
|
|
16
|
-
field = "#{visitor.parent_type_definition.graphql_name}.#{field_defn.graphql_name}"
|
|
17
|
-
@used_fields << field
|
|
18
|
-
@used_deprecated_fields << field if field_defn.deprecation_reason
|
|
19
|
-
arguments = visitor.query.arguments_for(node, field_defn)
|
|
20
|
-
# If there was an error when preparing this argument object,
|
|
21
|
-
# then this might be an error or something:
|
|
22
|
-
if arguments.respond_to?(:argument_values)
|
|
23
|
-
extract_deprecated_arguments(arguments.argument_values)
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def result
|
|
28
|
-
{
|
|
29
|
-
used_fields: @used_fields.to_a,
|
|
30
|
-
used_deprecated_fields: @used_deprecated_fields.to_a,
|
|
31
|
-
used_deprecated_arguments: @used_deprecated_arguments.to_a,
|
|
32
|
-
used_deprecated_enum_values: @used_deprecated_enum_values.to_a,
|
|
33
|
-
}
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
private
|
|
37
|
-
|
|
38
|
-
def extract_deprecated_arguments(argument_values)
|
|
39
|
-
argument_values.each_pair do |_argument_name, argument|
|
|
40
|
-
if argument.definition.deprecation_reason
|
|
41
|
-
@used_deprecated_arguments << argument.definition.path
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
next if argument.value.nil?
|
|
45
|
-
|
|
46
|
-
argument_type = argument.definition.type
|
|
47
|
-
if argument_type.non_null?
|
|
48
|
-
argument_type = argument_type.of_type
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
if argument_type.kind.input_object?
|
|
52
|
-
extract_deprecated_arguments(argument.value.arguments.argument_values) # rubocop:disable Development/ContextIsPassedCop -- runtime args instance
|
|
53
|
-
elsif argument_type.kind.enum?
|
|
54
|
-
extract_deprecated_enum_value(argument_type, argument.value)
|
|
55
|
-
elsif argument_type.list?
|
|
56
|
-
inner_type = argument_type.unwrap
|
|
57
|
-
case inner_type.kind
|
|
58
|
-
when TypeKinds::INPUT_OBJECT
|
|
59
|
-
argument.value.each do |value|
|
|
60
|
-
extract_deprecated_arguments(value.arguments.argument_values) # rubocop:disable Development/ContextIsPassedCop -- runtime args instance
|
|
61
|
-
end
|
|
62
|
-
when TypeKinds::ENUM
|
|
63
|
-
argument.value.each do |value|
|
|
64
|
-
extract_deprecated_enum_value(inner_type, value)
|
|
65
|
-
end
|
|
66
|
-
else
|
|
67
|
-
# Not a kind of input that we track
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
def extract_deprecated_enum_value(enum_type, value)
|
|
74
|
-
enum_value = @query.warden.enum_values(enum_type).find { |ev| ev.value == value }
|
|
75
|
-
if enum_value&.deprecation_reason
|
|
76
|
-
@used_deprecated_enum_values << enum_value.path
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
end
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
module GraphQL
|
|
3
|
-
module Analysis
|
|
4
|
-
module AST
|
|
5
|
-
# Used under the hood to implement complexity validation,
|
|
6
|
-
# see {Schema#max_complexity} and {Query#max_complexity}
|
|
7
|
-
class MaxQueryComplexity < QueryComplexity
|
|
8
|
-
def result
|
|
9
|
-
return if subject.max_complexity.nil?
|
|
10
|
-
|
|
11
|
-
total_complexity = max_possible_complexity
|
|
12
|
-
|
|
13
|
-
if total_complexity > subject.max_complexity
|
|
14
|
-
GraphQL::AnalysisError.new("Query has complexity of #{total_complexity}, which exceeds max complexity of #{subject.max_complexity}")
|
|
15
|
-
else
|
|
16
|
-
nil
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
module GraphQL
|
|
3
|
-
module Analysis
|
|
4
|
-
module AST
|
|
5
|
-
class MaxQueryDepth < QueryDepth
|
|
6
|
-
def result
|
|
7
|
-
configured_max_depth = if query
|
|
8
|
-
query.max_depth
|
|
9
|
-
else
|
|
10
|
-
multiplex.schema.max_depth
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
if configured_max_depth && @max_depth > configured_max_depth
|
|
14
|
-
GraphQL::AnalysisError.new("Query has depth of #{@max_depth}, which exceeds max depth of #{configured_max_depth}")
|
|
15
|
-
else
|
|
16
|
-
nil
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|