graphql 2.4.5 → 2.5.0

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.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/lib/graphql/analysis/analyzer.rb +2 -1
  3. data/lib/graphql/analysis/visitor.rb +37 -40
  4. data/lib/graphql/analysis.rb +12 -9
  5. data/lib/graphql/autoload.rb +1 -0
  6. data/lib/graphql/backtrace/table.rb +118 -55
  7. data/lib/graphql/backtrace.rb +1 -19
  8. data/lib/graphql/current.rb +5 -0
  9. data/lib/graphql/dashboard/detailed_traces.rb +47 -0
  10. data/lib/graphql/dashboard/installable.rb +22 -0
  11. data/lib/graphql/dashboard/limiters.rb +93 -0
  12. data/lib/graphql/dashboard/operation_store.rb +199 -0
  13. data/lib/graphql/dashboard/statics/bootstrap-5.3.3.min.css +6 -0
  14. data/lib/graphql/dashboard/statics/bootstrap-5.3.3.min.js +7 -0
  15. data/lib/graphql/dashboard/statics/charts.min.css +1 -0
  16. data/lib/graphql/dashboard/statics/dashboard.css +30 -0
  17. data/lib/graphql/dashboard/statics/dashboard.js +143 -0
  18. data/lib/graphql/dashboard/statics/header-icon.png +0 -0
  19. data/lib/graphql/dashboard/statics/icon.png +0 -0
  20. data/lib/graphql/dashboard/subscriptions.rb +96 -0
  21. data/lib/graphql/dashboard/views/graphql/dashboard/detailed_traces/traces/index.html.erb +45 -0
  22. data/lib/graphql/dashboard/views/graphql/dashboard/landings/show.html.erb +18 -0
  23. data/lib/graphql/dashboard/views/graphql/dashboard/limiters/limiters/show.html.erb +62 -0
  24. data/lib/graphql/dashboard/views/graphql/dashboard/not_installed.html.erb +18 -0
  25. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/_form.html.erb +23 -0
  26. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/edit.html.erb +21 -0
  27. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/index.html.erb +69 -0
  28. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/new.html.erb +7 -0
  29. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/index.html.erb +39 -0
  30. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/show.html.erb +32 -0
  31. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/index.html.erb +81 -0
  32. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/show.html.erb +71 -0
  33. data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/subscriptions/show.html.erb +41 -0
  34. data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/index.html.erb +55 -0
  35. data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/show.html.erb +40 -0
  36. data/lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb +108 -0
  37. data/lib/graphql/dashboard.rb +158 -0
  38. data/lib/graphql/dataloader/active_record_association_source.rb +64 -0
  39. data/lib/graphql/dataloader/active_record_source.rb +26 -0
  40. data/lib/graphql/dataloader/async_dataloader.rb +17 -5
  41. data/lib/graphql/dataloader/null_dataloader.rb +1 -1
  42. data/lib/graphql/dataloader/source.rb +2 -2
  43. data/lib/graphql/dataloader.rb +37 -5
  44. data/lib/graphql/execution/interpreter/runtime/graphql_result.rb +11 -4
  45. data/lib/graphql/execution/interpreter/runtime.rb +71 -34
  46. data/lib/graphql/execution/interpreter.rb +12 -3
  47. data/lib/graphql/execution/multiplex.rb +1 -5
  48. data/lib/graphql/introspection/directive_location_enum.rb +1 -1
  49. data/lib/graphql/invalid_name_error.rb +1 -1
  50. data/lib/graphql/invalid_null_error.rb +5 -15
  51. data/lib/graphql/language/lexer.rb +7 -3
  52. data/lib/graphql/language/nodes.rb +3 -0
  53. data/lib/graphql/language/parser.rb +15 -8
  54. data/lib/graphql/language/static_visitor.rb +37 -33
  55. data/lib/graphql/language/visitor.rb +59 -55
  56. data/lib/graphql/query.rb +7 -13
  57. data/lib/graphql/railtie.rb +1 -1
  58. data/lib/graphql/schema/argument.rb +7 -8
  59. data/lib/graphql/schema/build_from_definition.rb +99 -53
  60. data/lib/graphql/schema/directive.rb +1 -1
  61. data/lib/graphql/schema/enum.rb +36 -1
  62. data/lib/graphql/schema/enum_value.rb +1 -1
  63. data/lib/graphql/schema/field.rb +2 -2
  64. data/lib/graphql/schema/input_object.rb +16 -16
  65. data/lib/graphql/schema/interface.rb +2 -1
  66. data/lib/graphql/schema/member/has_arguments.rb +13 -5
  67. data/lib/graphql/schema/member/has_dataloader.rb +60 -0
  68. data/lib/graphql/schema/member/has_directives.rb +1 -1
  69. data/lib/graphql/schema/member/has_fields.rb +1 -1
  70. data/lib/graphql/schema/member/has_interfaces.rb +1 -1
  71. data/lib/graphql/schema/member/scoped.rb +1 -1
  72. data/lib/graphql/schema/member/type_system_helpers.rb +1 -1
  73. data/lib/graphql/schema/member.rb +1 -0
  74. data/lib/graphql/schema/object.rb +17 -8
  75. data/lib/graphql/schema/resolver.rb +6 -5
  76. data/lib/graphql/schema/subscription.rb +50 -4
  77. data/lib/graphql/schema/validator/required_validator.rb +23 -6
  78. data/lib/graphql/schema/visibility/migration.rb +1 -0
  79. data/lib/graphql/schema/visibility/profile.rb +11 -5
  80. data/lib/graphql/schema/visibility.rb +14 -9
  81. data/lib/graphql/schema/warden.rb +14 -1
  82. data/lib/graphql/schema.rb +63 -35
  83. data/lib/graphql/static_validation/all_rules.rb +1 -1
  84. data/lib/graphql/static_validation/rules/fields_will_merge.rb +1 -1
  85. data/lib/graphql/static_validation/rules/not_single_subscription_error.rb +25 -0
  86. data/lib/graphql/static_validation/rules/subscription_root_exists_and_single_subscription_selection.rb +26 -0
  87. data/lib/graphql/static_validation/validator.rb +6 -1
  88. data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +12 -10
  89. data/lib/graphql/subscriptions/event.rb +12 -1
  90. data/lib/graphql/subscriptions/serialize.rb +1 -1
  91. data/lib/graphql/testing/helpers.rb +5 -2
  92. data/lib/graphql/tracing/active_support_notifications_trace.rb +14 -3
  93. data/lib/graphql/tracing/active_support_notifications_tracing.rb +1 -1
  94. data/lib/graphql/tracing/appoptics_trace.rb +9 -1
  95. data/lib/graphql/tracing/appoptics_tracing.rb +7 -0
  96. data/lib/graphql/tracing/appsignal_trace.rb +32 -55
  97. data/lib/graphql/tracing/appsignal_tracing.rb +2 -0
  98. data/lib/graphql/tracing/call_legacy_tracers.rb +66 -0
  99. data/lib/graphql/tracing/data_dog_trace.rb +46 -158
  100. data/lib/graphql/tracing/data_dog_tracing.rb +2 -0
  101. data/lib/graphql/tracing/detailed_trace/memory_backend.rb +60 -0
  102. data/lib/graphql/tracing/detailed_trace/redis_backend.rb +72 -0
  103. data/lib/graphql/tracing/detailed_trace.rb +93 -0
  104. data/lib/graphql/tracing/legacy_hooks_trace.rb +1 -0
  105. data/lib/graphql/tracing/legacy_trace.rb +4 -61
  106. data/lib/graphql/tracing/monitor_trace.rb +285 -0
  107. data/lib/graphql/tracing/new_relic_trace.rb +47 -54
  108. data/lib/graphql/tracing/new_relic_tracing.rb +2 -0
  109. data/lib/graphql/tracing/notifications_trace.rb +182 -34
  110. data/lib/graphql/tracing/notifications_tracing.rb +2 -0
  111. data/lib/graphql/tracing/null_trace.rb +9 -0
  112. data/lib/graphql/tracing/perfetto_trace/trace.proto +141 -0
  113. data/lib/graphql/tracing/perfetto_trace/trace_pb.rb +33 -0
  114. data/lib/graphql/tracing/perfetto_trace.rb +734 -0
  115. data/lib/graphql/tracing/platform_trace.rb +5 -0
  116. data/lib/graphql/tracing/prometheus_trace/graphql_collector.rb +2 -0
  117. data/lib/graphql/tracing/prometheus_trace.rb +72 -68
  118. data/lib/graphql/tracing/prometheus_tracing.rb +2 -0
  119. data/lib/graphql/tracing/scout_trace.rb +32 -55
  120. data/lib/graphql/tracing/scout_tracing.rb +2 -0
  121. data/lib/graphql/tracing/sentry_trace.rb +63 -94
  122. data/lib/graphql/tracing/statsd_trace.rb +33 -41
  123. data/lib/graphql/tracing/statsd_tracing.rb +2 -0
  124. data/lib/graphql/tracing/trace.rb +111 -1
  125. data/lib/graphql/tracing.rb +31 -30
  126. data/lib/graphql/types/relay/connection_behaviors.rb +1 -1
  127. data/lib/graphql/types/relay/edge_behaviors.rb +1 -1
  128. data/lib/graphql/version.rb +1 -1
  129. data/lib/graphql.rb +4 -29
  130. metadata +144 -11
  131. data/lib/graphql/backtrace/inspect_result.rb +0 -38
  132. data/lib/graphql/backtrace/trace.rb +0 -93
  133. data/lib/graphql/backtrace/tracer.rb +0 -80
  134. data/lib/graphql/schema/null_mask.rb +0 -11
  135. data/lib/graphql/static_validation/rules/subscription_root_exists.rb +0 -17
@@ -1,11 +1,14 @@
1
1
  # frozen_string_literal: true
2
+
3
+ require "graphql/tracing"
4
+
2
5
  module GraphQL
3
6
  module Tracing
4
7
  # This is the base class for a `trace` instance whose methods are called during query execution.
5
8
  # "Trace modes" are subclasses of this with custom tracing modules mixed in.
6
9
  #
7
10
  # A trace module may implement any of the methods on `Trace`, being sure to call `super`
8
- # to continue any tracing hooks and call the actual runtime behavior. See {GraphQL::Backtrace::Trace} for example.
11
+ # to continue any tracing hooks and call the actual runtime behavior.
9
12
  #
10
13
  class Trace
11
14
  # @param multiplex [GraphQL::Execution::Multiplex, nil]
@@ -20,6 +23,8 @@ module GraphQL
20
23
  yield
21
24
  end
22
25
 
26
+ # @param query_string [String]
27
+ # @return [void]
23
28
  def parse(query_string:)
24
29
  yield
25
30
  end
@@ -28,6 +33,22 @@ module GraphQL
28
33
  yield
29
34
  end
30
35
 
36
+ def begin_validate(query, validate)
37
+ end
38
+
39
+ def end_validate(query, validate, errors)
40
+ end
41
+
42
+ # @param multiplex [GraphQL::Execution::Multiplex]
43
+ # @param analyzers [Array<Class>]
44
+ # @return [void]
45
+ def begin_analyze_multiplex(multiplex, analyzers); end
46
+ # @param multiplex [GraphQL::Execution::Multiplex]
47
+ # @param analyzers [Array<Class>]
48
+ # @return [void]
49
+ def end_analyze_multiplex(multiplex, analyzers); end
50
+ # @param multiplex [GraphQL::Execution::Multiplex]
51
+ # @return [void]
31
52
  def analyze_multiplex(multiplex:)
32
53
  yield
33
54
  end
@@ -36,6 +57,9 @@ module GraphQL
36
57
  yield
37
58
  end
38
59
 
60
+ # This wraps an entire `.execute` call.
61
+ # @param multiplex [GraphQL::Execution::Multiplex]
62
+ # @return [void]
39
63
  def execute_multiplex(multiplex:)
40
64
  yield
41
65
  end
@@ -48,6 +72,20 @@ module GraphQL
48
72
  yield
49
73
  end
50
74
 
75
+ # GraphQL is about to resolve this field
76
+ # @param field [GraphQL::Schema::Field]
77
+ # @param object [GraphQL::Schema::Object]
78
+ # @param arguments [Hash]
79
+ # @param query [GraphQL::Query]
80
+ def begin_execute_field(field, object, arguments, query); end
81
+ # GraphQL just finished resolving this field
82
+ # @param field [GraphQL::Schema::Field]
83
+ # @param object [GraphQL::Schema::Object]
84
+ # @param arguments [Hash]
85
+ # @param query [GraphQL::Query]
86
+ # @param result [Object]
87
+ def end_execute_field(field, object, arguments, query, result); end
88
+
51
89
  def execute_field(field:, query:, ast_node:, arguments:, object:)
52
90
  yield
53
91
  end
@@ -60,6 +98,22 @@ module GraphQL
60
98
  yield
61
99
  end
62
100
 
101
+ # A call to `.authorized?` is starting
102
+ # @param type [Class<GraphQL::Schema::Object>]
103
+ # @param object [Object]
104
+ # @param context [GraphQL::Query::Context]
105
+ # @return [void]
106
+ def begin_authorized(type, object, context)
107
+ end
108
+ # A call to `.authorized?` just finished
109
+ # @param type [Class<GraphQL::Schema::Object>]
110
+ # @param object [Object]
111
+ # @param context [GraphQL::Query::Context]
112
+ # @param authorized_result [Boolean]
113
+ # @return [void]
114
+ def end_authorized(type, object, context, authorized_result)
115
+ end
116
+
63
117
  def authorized_lazy(query:, type:, object:)
64
118
  yield
65
119
  end
@@ -71,6 +125,62 @@ module GraphQL
71
125
  def resolve_type_lazy(query:, type:, object:)
72
126
  yield
73
127
  end
128
+
129
+ # A call to `.resolve_type` is starting
130
+ # @param type [Class<GraphQL::Schema::Union>, Module<GraphQL::Schema::Interface>]
131
+ # @param value [Object]
132
+ # @param context [GraphQL::Query::Context]
133
+ # @return [void]
134
+ def begin_resolve_type(type, value, context)
135
+ end
136
+
137
+ # A call to `.resolve_type` just ended
138
+ # @param type [Class<GraphQL::Schema::Union>, Module<GraphQL::Schema::Interface>]
139
+ # @param value [Object]
140
+ # @param context [GraphQL::Query::Context]
141
+ # @param resolved_type [Class<GraphQL::Schema::Object>]
142
+ # @return [void]
143
+ def end_resolve_type(type, value, context, resolved_type)
144
+ end
145
+
146
+ # A dataloader run is starting
147
+ # @param dataloader [GraphQL::Dataloader]
148
+ # @return [void]
149
+ def begin_dataloader(dataloader); end
150
+ # A dataloader run has ended
151
+ # @param dataloder [GraphQL::Dataloader]
152
+ # @return [void]
153
+ def end_dataloader(dataloader); end
154
+
155
+ # A source with pending keys is about to fetch
156
+ # @param source [GraphQL::Dataloader::Source]
157
+ # @return [void]
158
+ def begin_dataloader_source(source); end
159
+ # A fetch call has just ended
160
+ # @param source [GraphQL::Dataloader::Source]
161
+ # @return [void]
162
+ def end_dataloader_source(source); end
163
+
164
+ # Called when Dataloader spins up a new fiber for GraphQL execution
165
+ # @param jobs [Array<#call>] Execution steps to run
166
+ # @return [void]
167
+ def dataloader_spawn_execution_fiber(jobs); end
168
+ # Called when Dataloader spins up a new fiber for fetching data
169
+ # @param pending_sources [GraphQL::Dataloader::Source] Instances with pending keys
170
+ # @return [void]
171
+ def dataloader_spawn_source_fiber(pending_sources); end
172
+ # Called when an execution or source fiber terminates
173
+ # @return [void]
174
+ def dataloader_fiber_exit; end
175
+
176
+ # Called when a Dataloader fiber is paused to wait for data
177
+ # @param source [GraphQL::Dataloader::Source] The Source whose `load` call initiated this `yield`
178
+ # @return [void]
179
+ def dataloader_fiber_yield(source); end
180
+ # Called when a Dataloader fiber is resumed because data has been loaded
181
+ # @param source [GraphQL::Dataloader::Source] The Source whose `load` call previously caused this Fiber to wait
182
+ # @return [void]
183
+ def dataloader_fiber_resume(source); end
74
184
  end
75
185
  end
76
186
  end
@@ -1,38 +1,39 @@
1
1
  # frozen_string_literal: true
2
- require "graphql/tracing/trace"
3
- require "graphql/tracing/legacy_trace"
4
- require "graphql/tracing/legacy_hooks_trace"
5
2
 
6
- # Legacy tracing:
7
- require "graphql/tracing/active_support_notifications_tracing"
8
- require "graphql/tracing/platform_tracing"
9
- require "graphql/tracing/appoptics_tracing"
10
- require "graphql/tracing/appsignal_tracing"
11
- require "graphql/tracing/data_dog_tracing"
12
- require "graphql/tracing/new_relic_tracing"
13
- require "graphql/tracing/scout_tracing"
14
- require "graphql/tracing/statsd_tracing"
15
- require "graphql/tracing/prometheus_tracing"
16
-
17
- # New Tracing:
18
- require "graphql/tracing/active_support_notifications_trace"
19
- require "graphql/tracing/platform_trace"
20
- require "graphql/tracing/appoptics_trace"
21
- require "graphql/tracing/appsignal_trace"
22
- require "graphql/tracing/data_dog_trace"
23
- require "graphql/tracing/new_relic_trace"
24
- require "graphql/tracing/notifications_trace"
25
- require "graphql/tracing/sentry_trace"
26
- require "graphql/tracing/scout_trace"
27
- require "graphql/tracing/statsd_trace"
28
- require "graphql/tracing/prometheus_trace"
29
- if defined?(PrometheusExporter::Server)
30
- require "graphql/tracing/prometheus_trace/graphql_collector"
31
- end
32
3
 
33
4
  module GraphQL
34
5
  module Tracing
35
- NullTrace = Trace.new
6
+ autoload :Trace, "graphql/tracing/trace"
7
+ autoload :CallLegacyTracers, "graphql/tracing/call_legacy_tracers"
8
+ autoload :LegacyTrace, "graphql/tracing/legacy_trace"
9
+ autoload :LegacyHooksTrace, "graphql/tracing/legacy_hooks_trace"
10
+ autoload :NullTrace, "graphql/tracing/null_trace"
11
+
12
+ autoload :ActiveSupportNotificationsTracing, "graphql/tracing/active_support_notifications_tracing"
13
+ autoload :PlatformTracing, "graphql/tracing/platform_tracing"
14
+ autoload :AppOpticsTracing, "graphql/tracing/appoptics_tracing"
15
+ autoload :AppsignalTracing, "graphql/tracing/appsignal_tracing"
16
+ autoload :DataDogTracing, "graphql/tracing/data_dog_tracing"
17
+ autoload :NewRelicTracing, "graphql/tracing/new_relic_tracing"
18
+ autoload :NotificationsTracing, "graphql/tracing/notifications_tracing"
19
+ autoload :ScoutTracing, "graphql/tracing/scout_tracing"
20
+ autoload :StatsdTracing, "graphql/tracing/statsd_tracing"
21
+ autoload :PrometheusTracing, "graphql/tracing/prometheus_tracing"
22
+
23
+ autoload :ActiveSupportNotificationsTrace, "graphql/tracing/active_support_notifications_trace"
24
+ autoload :PlatformTrace, "graphql/tracing/platform_trace"
25
+ autoload :AppOpticsTrace, "graphql/tracing/appoptics_trace"
26
+ autoload :AppsignalTrace, "graphql/tracing/appsignal_trace"
27
+ autoload :DataDogTrace, "graphql/tracing/data_dog_trace"
28
+ autoload :MonitorTrace, "graphql/tracing/monitor_trace"
29
+ autoload :NewRelicTrace, "graphql/tracing/new_relic_trace"
30
+ autoload :NotificationsTrace, "graphql/tracing/notifications_trace"
31
+ autoload :SentryTrace, "graphql/tracing/sentry_trace"
32
+ autoload :ScoutTrace, "graphql/tracing/scout_trace"
33
+ autoload :StatsdTrace, "graphql/tracing/statsd_trace"
34
+ autoload :PrometheusTrace, "graphql/tracing/prometheus_trace"
35
+ autoload :PerfettoTrace, "graphql/tracing/perfetto_trace"
36
+ autoload :DetailedTrace, "graphql/tracing/detailed_trace"
36
37
 
37
38
  # Objects may include traceable to gain a `.trace(...)` method.
38
39
  # The object must have a `@tracers` ivar of type `Array<<#trace(k, d, &b)>>`.
@@ -13,7 +13,7 @@ module GraphQL
13
13
  child_class.node_nullable(true)
14
14
  child_class.edges_nullable(true)
15
15
  child_class.edge_nullable(true)
16
- child_class.module_eval {
16
+ child_class.module_exec {
17
17
  self.edge_type = nil
18
18
  self.node_type = nil
19
19
  self.edge_class = nil
@@ -8,7 +8,7 @@ module GraphQL
8
8
  child_class.description("An edge in a connection.")
9
9
  child_class.field(:cursor, String, null: false, description: "A cursor for use in pagination.")
10
10
  child_class.extend(ClassMethods)
11
- child_class.class_eval { self.node_type = nil }
11
+ child_class.class_exec { self.node_type = nil }
12
12
  child_class.node_nullable(true)
13
13
  child_class.default_broadcastable(nil)
14
14
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "2.4.5"
3
+ VERSION = "2.5.0"
4
4
  end
data/lib/graphql.rb CHANGED
@@ -15,6 +15,7 @@ module GraphQL
15
15
  super
16
16
  Query.eager_load!
17
17
  Types.eager_load!
18
+ Schema.eager_load!
18
19
  end
19
20
 
20
21
  class Error < StandardError
@@ -81,35 +82,6 @@ This is probably a bug in GraphQL-Ruby, please report this error on GitHub: http
81
82
  class << self
82
83
  # If true, the parser should raise when an integer or float is followed immediately by an identifier (instead of a space or punctuation)
83
84
  attr_accessor :reject_numbers_followed_by_names
84
-
85
- # If `production?` is detected but `eager_load!` wasn't called, emit a warning.
86
- # @return [void]
87
- def ensure_eager_load!
88
- if production? && !eager_loading?
89
- warn <<~WARNING
90
- GraphQL-Ruby thinks this is a production deployment but didn't eager-load its constants. Address this by:
91
-
92
- - Calling `GraphQL.eager_load!` in a production-only initializer or setup hook
93
- - Assign `GraphQL.env = "..."` to something _other_ than `"production"` (for example, `GraphQL.env = "development"`)
94
-
95
- More details: https://graphql-ruby.org/schema/definition#production-considerations
96
- WARNING
97
- end
98
- end
99
-
100
- attr_accessor :env
101
-
102
- private
103
-
104
- # Detect whether this is a production deployment or not
105
- def production?
106
- if env
107
- # Manually assigned to production?
108
- env == "production"
109
- else
110
- (detected_env = ENV["RACK_ENV"] || ENV["RAILS_ENV"] || ENV["HANAMI_ENV"] || ENV["APP_ENV"]) && detected_env.to_s.downcase == "production"
111
- end
112
- end
113
85
  end
114
86
 
115
87
  self.reject_numbers_followed_by_names = false
@@ -153,6 +125,9 @@ This is probably a bug in GraphQL-Ruby, please report this error on GitHub: http
153
125
  autoload :LoadApplicationObjectFailedError, "graphql/load_application_object_failed_error"
154
126
  autoload :Testing, "graphql/testing"
155
127
  autoload :Current, "graphql/current"
128
+ if defined?(::Rails::Engine)
129
+ autoload :Dashboard, 'graphql/dashboard'
130
+ end
156
131
  end
157
132
 
158
133
  require "graphql/version"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.5
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-02 00:00:00.000000000 Z
10
+ date: 2025-04-01 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: base64
@@ -38,6 +37,20 @@ dependencies:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
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'
41
54
  - !ruby/object:Gem::Dependency
42
55
  name: benchmark-ips
43
56
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +79,20 @@ dependencies:
66
79
  - - "~>"
67
80
  - !ruby/object:Gem::Version
68
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'
69
96
  - !ruby/object:Gem::Dependency
70
97
  name: graphql-batch
71
98
  requirement: !ruby/object:Gem::Requirement
@@ -178,6 +205,48 @@ dependencies:
178
205
  - - ">="
179
206
  - !ruby/object:Gem::Version
180
207
  version: '0'
208
+ - !ruby/object:Gem::Dependency
209
+ name: simplecov
210
+ requirement: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ version: '0'
215
+ type: :development
216
+ prerelease: false
217
+ version_requirements: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - ">="
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
222
+ - !ruby/object:Gem::Dependency
223
+ name: simplecov-lcov
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: undercover
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'
181
250
  - !ruby/object:Gem::Dependency
182
251
  name: jekyll
183
252
  requirement: !ruby/object:Gem::Requirement
@@ -192,6 +261,20 @@ dependencies:
192
261
  - - ">="
193
262
  - !ruby/object:Gem::Version
194
263
  version: '0'
264
+ - !ruby/object:Gem::Dependency
265
+ name: jekyll-sass-converter
266
+ requirement: !ruby/object:Gem::Requirement
267
+ requirements:
268
+ - - "~>"
269
+ - !ruby/object:Gem::Version
270
+ version: '2.2'
271
+ type: :development
272
+ prerelease: false
273
+ version_requirements: !ruby/object:Gem::Requirement
274
+ requirements:
275
+ - - "~>"
276
+ - !ruby/object:Gem::Version
277
+ version: '2.2'
195
278
  - !ruby/object:Gem::Dependency
196
279
  name: yard
197
280
  requirement: !ruby/object:Gem::Requirement
@@ -248,6 +331,20 @@ dependencies:
248
331
  - - "~>"
249
332
  - !ruby/object:Gem::Version
250
333
  version: 1.5.0
334
+ - !ruby/object:Gem::Dependency
335
+ name: mutex_m
336
+ requirement: !ruby/object:Gem::Requirement
337
+ requirements:
338
+ - - ">="
339
+ - !ruby/object:Gem::Version
340
+ version: '0'
341
+ type: :development
342
+ prerelease: false
343
+ version_requirements: !ruby/object:Gem::Requirement
344
+ requirements:
345
+ - - ">="
346
+ - !ruby/object:Gem::Version
347
+ version: '0'
251
348
  - !ruby/object:Gem::Dependency
252
349
  name: webrick
253
350
  requirement: !ruby/object:Gem::Requirement
@@ -330,14 +427,42 @@ files:
330
427
  - lib/graphql/analysis_error.rb
331
428
  - lib/graphql/autoload.rb
332
429
  - lib/graphql/backtrace.rb
333
- - lib/graphql/backtrace/inspect_result.rb
334
430
  - lib/graphql/backtrace/table.rb
335
- - lib/graphql/backtrace/trace.rb
336
431
  - lib/graphql/backtrace/traced_error.rb
337
- - lib/graphql/backtrace/tracer.rb
338
432
  - lib/graphql/coercion_error.rb
339
433
  - lib/graphql/current.rb
434
+ - lib/graphql/dashboard.rb
435
+ - lib/graphql/dashboard/detailed_traces.rb
436
+ - lib/graphql/dashboard/installable.rb
437
+ - lib/graphql/dashboard/limiters.rb
438
+ - lib/graphql/dashboard/operation_store.rb
439
+ - lib/graphql/dashboard/statics/bootstrap-5.3.3.min.css
440
+ - lib/graphql/dashboard/statics/bootstrap-5.3.3.min.js
441
+ - lib/graphql/dashboard/statics/charts.min.css
442
+ - lib/graphql/dashboard/statics/dashboard.css
443
+ - lib/graphql/dashboard/statics/dashboard.js
444
+ - lib/graphql/dashboard/statics/header-icon.png
445
+ - lib/graphql/dashboard/statics/icon.png
446
+ - lib/graphql/dashboard/subscriptions.rb
447
+ - lib/graphql/dashboard/views/graphql/dashboard/detailed_traces/traces/index.html.erb
448
+ - lib/graphql/dashboard/views/graphql/dashboard/landings/show.html.erb
449
+ - lib/graphql/dashboard/views/graphql/dashboard/limiters/limiters/show.html.erb
450
+ - lib/graphql/dashboard/views/graphql/dashboard/not_installed.html.erb
451
+ - lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/_form.html.erb
452
+ - lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/edit.html.erb
453
+ - lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/index.html.erb
454
+ - lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/new.html.erb
455
+ - lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/index.html.erb
456
+ - lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/show.html.erb
457
+ - lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/index.html.erb
458
+ - lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/show.html.erb
459
+ - lib/graphql/dashboard/views/graphql/dashboard/subscriptions/subscriptions/show.html.erb
460
+ - lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/index.html.erb
461
+ - lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/show.html.erb
462
+ - lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb
340
463
  - lib/graphql/dataloader.rb
464
+ - lib/graphql/dataloader/active_record_association_source.rb
465
+ - lib/graphql/dataloader/active_record_source.rb
341
466
  - lib/graphql/dataloader/async_dataloader.rb
342
467
  - lib/graphql/dataloader/null_dataloader.rb
343
468
  - lib/graphql/dataloader/request.rb
@@ -466,6 +591,7 @@ files:
466
591
  - lib/graphql/schema/member/graphql_type_names.rb
467
592
  - lib/graphql/schema/member/has_arguments.rb
468
593
  - lib/graphql/schema/member/has_ast_node.rb
594
+ - lib/graphql/schema/member/has_dataloader.rb
469
595
  - lib/graphql/schema/member/has_deprecation_reason.rb
470
596
  - lib/graphql/schema/member/has_directives.rb
471
597
  - lib/graphql/schema/member/has_fields.rb
@@ -479,7 +605,6 @@ files:
479
605
  - lib/graphql/schema/member/validates_input.rb
480
606
  - lib/graphql/schema/mutation.rb
481
607
  - lib/graphql/schema/non_null.rb
482
- - lib/graphql/schema/null_mask.rb
483
608
  - lib/graphql/schema/object.rb
484
609
  - lib/graphql/schema/printer.rb
485
610
  - lib/graphql/schema/relay_classic_mutation.rb
@@ -551,6 +676,7 @@ files:
551
676
  - lib/graphql/static_validation/rules/mutation_root_exists_error.rb
552
677
  - lib/graphql/static_validation/rules/no_definitions_are_present.rb
553
678
  - lib/graphql/static_validation/rules/no_definitions_are_present_error.rb
679
+ - lib/graphql/static_validation/rules/not_single_subscription_error.rb
554
680
  - lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb
555
681
  - lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb
556
682
  - lib/graphql/static_validation/rules/operation_names_are_valid.rb
@@ -561,7 +687,7 @@ files:
561
687
  - lib/graphql/static_validation/rules/required_arguments_are_present_error.rb
562
688
  - lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb
563
689
  - lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb
564
- - lib/graphql/static_validation/rules/subscription_root_exists.rb
690
+ - lib/graphql/static_validation/rules/subscription_root_exists_and_single_subscription_selection.rb
565
691
  - lib/graphql/static_validation/rules/subscription_root_exists_error.rb
566
692
  - lib/graphql/static_validation/rules/unique_directives_per_location.rb
567
693
  - lib/graphql/static_validation/rules/unique_directives_per_location_error.rb
@@ -594,14 +720,23 @@ files:
594
720
  - lib/graphql/tracing/appoptics_tracing.rb
595
721
  - lib/graphql/tracing/appsignal_trace.rb
596
722
  - lib/graphql/tracing/appsignal_tracing.rb
723
+ - lib/graphql/tracing/call_legacy_tracers.rb
597
724
  - lib/graphql/tracing/data_dog_trace.rb
598
725
  - lib/graphql/tracing/data_dog_tracing.rb
726
+ - lib/graphql/tracing/detailed_trace.rb
727
+ - lib/graphql/tracing/detailed_trace/memory_backend.rb
728
+ - lib/graphql/tracing/detailed_trace/redis_backend.rb
599
729
  - lib/graphql/tracing/legacy_hooks_trace.rb
600
730
  - lib/graphql/tracing/legacy_trace.rb
731
+ - lib/graphql/tracing/monitor_trace.rb
601
732
  - lib/graphql/tracing/new_relic_trace.rb
602
733
  - lib/graphql/tracing/new_relic_tracing.rb
603
734
  - lib/graphql/tracing/notifications_trace.rb
604
735
  - lib/graphql/tracing/notifications_tracing.rb
736
+ - lib/graphql/tracing/null_trace.rb
737
+ - lib/graphql/tracing/perfetto_trace.rb
738
+ - lib/graphql/tracing/perfetto_trace/trace.proto
739
+ - lib/graphql/tracing/perfetto_trace/trace_pb.rb
605
740
  - lib/graphql/tracing/platform_trace.rb
606
741
  - lib/graphql/tracing/platform_tracing.rb
607
742
  - lib/graphql/tracing/prometheus_trace.rb
@@ -652,7 +787,6 @@ metadata:
652
787
  bug_tracker_uri: https://github.com/rmosolgo/graphql-ruby/issues
653
788
  mailing_list_uri: https://buttondown.email/graphql-ruby
654
789
  rubygems_mfa_required: 'true'
655
- post_install_message:
656
790
  rdoc_options: []
657
791
  require_paths:
658
792
  - lib
@@ -667,8 +801,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
667
801
  - !ruby/object:Gem::Version
668
802
  version: '0'
669
803
  requirements: []
670
- rubygems_version: 3.5.12
671
- signing_key:
804
+ rubygems_version: 3.6.6
672
805
  specification_version: 4
673
806
  summary: A GraphQL language and runtime for Ruby
674
807
  test_files: []
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
- module GraphQL
3
- class Backtrace
4
- module InspectResult
5
- module_function
6
-
7
- def inspect_result(obj)
8
- case obj
9
- when Hash
10
- "{" +
11
- obj.map do |key, val|
12
- "#{key}: #{inspect_truncated(val)}"
13
- end.join(", ") +
14
- "}"
15
- when Array
16
- "[" +
17
- obj.map { |v| inspect_truncated(v) }.join(", ") +
18
- "]"
19
- else
20
- inspect_truncated(obj)
21
- end
22
- end
23
-
24
- def inspect_truncated(obj)
25
- case obj
26
- when Hash
27
- "{...}"
28
- when Array
29
- "[...]"
30
- when GraphQL::Execution::Lazy
31
- "(unresolved)"
32
- else
33
- "#{obj.inspect}"
34
- end
35
- end
36
- end
37
- end
38
- end