graphql 2.4.14 → 2.4.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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/lib/graphql/backtrace/table.rb +37 -14
  3. data/lib/graphql/dashboard/detailed_traces.rb +47 -0
  4. data/lib/graphql/dashboard/installable.rb +22 -0
  5. data/lib/graphql/dashboard/limiters.rb +93 -0
  6. data/lib/graphql/dashboard/operation_store.rb +199 -0
  7. data/lib/graphql/dashboard/statics/charts.min.css +1 -0
  8. data/lib/graphql/dashboard/statics/dashboard.css +27 -0
  9. data/lib/graphql/dashboard/statics/dashboard.js +74 -9
  10. data/lib/graphql/dashboard/subscriptions.rb +96 -0
  11. data/lib/graphql/dashboard/views/graphql/dashboard/detailed_traces/traces/index.html.erb +45 -0
  12. data/lib/graphql/dashboard/views/graphql/dashboard/limiters/limiters/show.html.erb +62 -0
  13. data/lib/graphql/dashboard/views/graphql/dashboard/not_installed.html.erb +18 -0
  14. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/_form.html.erb +23 -0
  15. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/edit.html.erb +21 -0
  16. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/index.html.erb +69 -0
  17. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/new.html.erb +7 -0
  18. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/index.html.erb +39 -0
  19. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/show.html.erb +32 -0
  20. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/index.html.erb +81 -0
  21. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/show.html.erb +71 -0
  22. data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/subscriptions/show.html.erb +41 -0
  23. data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/index.html.erb +55 -0
  24. data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/show.html.erb +40 -0
  25. data/lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb +49 -1
  26. data/lib/graphql/dashboard.rb +45 -29
  27. data/lib/graphql/execution/interpreter/runtime.rb +11 -1
  28. data/lib/graphql/execution/interpreter.rb +4 -2
  29. data/lib/graphql/execution/multiplex.rb +1 -1
  30. data/lib/graphql/language/parser.rb +13 -6
  31. data/lib/graphql/query.rb +2 -1
  32. data/lib/graphql/schema/argument.rb +4 -3
  33. data/lib/graphql/schema/build_from_definition.rb +91 -46
  34. data/lib/graphql/schema/input_object.rb +9 -8
  35. data/lib/graphql/schema.rb +3 -1
  36. data/lib/graphql/testing/helpers.rb +5 -2
  37. data/lib/graphql/tracing/perfetto_trace.rb +4 -4
  38. data/lib/graphql/version.rb +1 -1
  39. metadata +23 -35
  40. data/lib/graphql/dashboard/views/graphql/dashboard/traces/index.html.erb +0 -63
@@ -20,8 +20,8 @@ module GraphQL
20
20
  from_document(schema_superclass, parser.parse_file(definition_path), **kwargs)
21
21
  end
22
22
 
23
- def from_document(schema_superclass, document, default_resolve:, using: {}, relay: false)
24
- Builder.build(schema_superclass, document, default_resolve: default_resolve || {}, relay: relay, using: using)
23
+ def from_document(schema_superclass, document, default_resolve:, using: {}, base_types: {}, relay: false)
24
+ Builder.build(schema_superclass, document, default_resolve: default_resolve || {}, relay: relay, using: using, base_types: base_types)
25
25
  end
26
26
  end
27
27
 
@@ -30,9 +30,18 @@ module GraphQL
30
30
  include GraphQL::EmptyObjects
31
31
  extend self
32
32
 
33
- def build(schema_superclass, document, default_resolve:, using: {}, relay:)
33
+ def build(schema_superclass, document, default_resolve:, using: {}, base_types: {}, relay:)
34
34
  raise InvalidDocumentError.new('Must provide a document ast.') if !document || !document.is_a?(GraphQL::Language::Nodes::Document)
35
35
 
36
+ base_types = {
37
+ object: GraphQL::Schema::Object,
38
+ interface: GraphQL::Schema::Interface,
39
+ union: GraphQL::Schema::Union,
40
+ scalar: GraphQL::Schema::Scalar,
41
+ enum: GraphQL::Schema::Enum,
42
+ input_object: GraphQL::Schema::InputObject,
43
+ }.merge!(base_types)
44
+
36
45
  if default_resolve.is_a?(Hash)
37
46
  default_resolve = ResolveMap.new(default_resolve)
38
47
  end
@@ -53,7 +62,7 @@ module GraphQL
53
62
  types[type_name] ||= begin
54
63
  defn = document.definitions.find { |d| d.respond_to?(:name) && d.name == type_name }
55
64
  if defn
56
- build_definition_from_node(defn, directive_type_resolver, default_resolve)
65
+ build_definition_from_node(defn, directive_type_resolver, default_resolve, base_types)
57
66
  elsif (built_in_defn = GraphQL::Schema::BUILT_IN_TYPES[type_name])
58
67
  built_in_defn
59
68
  else
@@ -77,14 +86,20 @@ module GraphQL
77
86
  case definition
78
87
  when GraphQL::Language::Nodes::SchemaDefinition, GraphQL::Language::Nodes::DirectiveDefinition
79
88
  nil # already handled
80
- when GraphQL::Language::Nodes::SchemaExtension
89
+ when GraphQL::Language::Nodes::SchemaExtension,
90
+ GraphQL::Language::Nodes::ScalarTypeExtension,
91
+ GraphQL::Language::Nodes::ObjectTypeExtension,
92
+ GraphQL::Language::Nodes::InterfaceTypeExtension,
93
+ GraphQL::Language::Nodes::UnionTypeExtension,
94
+ GraphQL::Language::Nodes::EnumTypeExtension,
95
+ GraphQL::Language::Nodes::InputObjectTypeExtension
81
96
  schema_extensions ||= []
82
97
  schema_extensions << definition
83
98
  else
84
99
  # It's possible that this was already loaded by the directives
85
100
  prev_type = types[definition.name]
86
101
  if prev_type.nil? || prev_type.is_a?(Schema::LateBoundType)
87
- types[definition.name] = build_definition_from_node(definition, type_resolver, default_resolve)
102
+ types[definition.name] = build_definition_from_node(definition, type_resolver, default_resolve, base_types)
88
103
  end
89
104
  end
90
105
  end
@@ -124,6 +139,34 @@ module GraphQL
124
139
 
125
140
  raise InvalidDocumentError.new('Must provide schema definition with query type or a type named Query.') unless query_root_type
126
141
 
142
+ schema_extensions&.each do |ext|
143
+ next if ext.is_a?(GraphQL::Language::Nodes::SchemaExtension)
144
+
145
+ built_type = types[ext.name]
146
+
147
+ case ext
148
+ when GraphQL::Language::Nodes::ScalarTypeExtension
149
+ build_directives(built_type, ext, type_resolver)
150
+ when GraphQL::Language::Nodes::ObjectTypeExtension
151
+ build_directives(built_type, ext, type_resolver)
152
+ build_fields(built_type, ext.fields, type_resolver, default_resolve: true)
153
+ build_interfaces(built_type, ext.interfaces, type_resolver)
154
+ when GraphQL::Language::Nodes::InterfaceTypeExtension
155
+ build_directives(built_type, ext, type_resolver)
156
+ build_fields(built_type, ext.fields, type_resolver, default_resolve: nil)
157
+ build_interfaces(built_type, ext.interfaces, type_resolver)
158
+ when GraphQL::Language::Nodes::UnionTypeExtension
159
+ build_directives(built_type, ext, type_resolver)
160
+ built_type.possible_types(*ext.types.map { |type_name| type_resolver.call(type_name) })
161
+ when GraphQL::Language::Nodes::EnumTypeExtension
162
+ build_directives(built_type, ext, type_resolver)
163
+ build_values(built_type, ext.values, type_resolver)
164
+ when GraphQL::Language::Nodes::InputObjectTypeExtension
165
+ build_directives(built_type, ext, type_resolver)
166
+ build_arguments(built_type, ext.fields, type_resolver)
167
+ end
168
+ end
169
+
127
170
  builder = self
128
171
 
129
172
  found_types = types.values
@@ -192,8 +235,8 @@ module GraphQL
192
235
  end
193
236
  end
194
237
 
195
- if schema_extensions
196
- schema_extensions.each do |ext|
238
+ schema_extensions&.each do |ext|
239
+ if ext.is_a?(GraphQL::Language::Nodes::SchemaExtension)
197
240
  build_directives(schema_class, ext, type_resolver)
198
241
  end
199
242
  end
@@ -205,20 +248,20 @@ module GraphQL
205
248
  raise(GraphQL::RequiredImplementationMissingError, "Generated Schema cannot use Interface or Union types for execution. Implement resolve_type on your resolver.")
206
249
  }
207
250
 
208
- def build_definition_from_node(definition, type_resolver, default_resolve)
251
+ def build_definition_from_node(definition, type_resolver, default_resolve, base_types)
209
252
  case definition
210
253
  when GraphQL::Language::Nodes::EnumTypeDefinition
211
- build_enum_type(definition, type_resolver)
254
+ build_enum_type(definition, type_resolver, base_types[:enum])
212
255
  when GraphQL::Language::Nodes::ObjectTypeDefinition
213
- build_object_type(definition, type_resolver)
256
+ build_object_type(definition, type_resolver, base_types[:object])
214
257
  when GraphQL::Language::Nodes::InterfaceTypeDefinition
215
- build_interface_type(definition, type_resolver)
258
+ build_interface_type(definition, type_resolver, base_types[:interface])
216
259
  when GraphQL::Language::Nodes::UnionTypeDefinition
217
- build_union_type(definition, type_resolver)
260
+ build_union_type(definition, type_resolver, base_types[:union])
218
261
  when GraphQL::Language::Nodes::ScalarTypeDefinition
219
- build_scalar_type(definition, type_resolver, default_resolve: default_resolve)
262
+ build_scalar_type(definition, type_resolver, base_types[:scalar], default_resolve: default_resolve)
220
263
  when GraphQL::Language::Nodes::InputObjectTypeDefinition
221
- build_input_object_type(definition, type_resolver)
264
+ build_input_object_type(definition, type_resolver, base_types[:input_object])
222
265
  end
223
266
  end
224
267
 
@@ -284,22 +327,26 @@ module GraphQL
284
327
  end
285
328
  end
286
329
 
287
- def build_enum_type(enum_type_definition, type_resolver)
330
+ def build_enum_type(enum_type_definition, type_resolver, base_type)
288
331
  builder = self
289
- Class.new(GraphQL::Schema::Enum) do
332
+ Class.new(base_type) do
290
333
  graphql_name(enum_type_definition.name)
291
334
  builder.build_directives(self, enum_type_definition, type_resolver)
292
335
  description(enum_type_definition.description)
293
336
  ast_node(enum_type_definition)
294
- enum_type_definition.values.each do |enum_value_definition|
295
- value(enum_value_definition.name,
296
- value: enum_value_definition.name,
297
- deprecation_reason: builder.build_deprecation_reason(enum_value_definition.directives),
298
- description: enum_value_definition.description,
299
- directives: builder.prepare_directives(enum_value_definition, type_resolver),
300
- ast_node: enum_value_definition,
301
- )
302
- end
337
+ builder.build_values(self, enum_type_definition.values, type_resolver)
338
+ end
339
+ end
340
+
341
+ def build_values(type_class, enum_value_definitions, type_resolver)
342
+ enum_value_definitions.each do |enum_value_definition|
343
+ type_class.value(enum_value_definition.name,
344
+ value: enum_value_definition.name,
345
+ deprecation_reason: build_deprecation_reason(enum_value_definition.directives),
346
+ description: enum_value_definition.description,
347
+ directives: prepare_directives(enum_value_definition, type_resolver),
348
+ ast_node: enum_value_definition,
349
+ )
303
350
  end
304
351
  end
305
352
 
@@ -313,9 +360,9 @@ module GraphQL
313
360
  reason.value
314
361
  end
315
362
 
316
- def build_scalar_type(scalar_type_definition, type_resolver, default_resolve:)
363
+ def build_scalar_type(scalar_type_definition, type_resolver, base_type, default_resolve:)
317
364
  builder = self
318
- Class.new(GraphQL::Schema::Scalar) do
365
+ Class.new(base_type) do
319
366
  graphql_name(scalar_type_definition.name)
320
367
  description(scalar_type_definition.description)
321
368
  ast_node(scalar_type_definition)
@@ -336,9 +383,9 @@ module GraphQL
336
383
  end
337
384
  end
338
385
 
339
- def build_union_type(union_type_definition, type_resolver)
386
+ def build_union_type(union_type_definition, type_resolver, base_type)
340
387
  builder = self
341
- Class.new(GraphQL::Schema::Union) do
388
+ Class.new(base_type) do
342
389
  graphql_name(union_type_definition.name)
343
390
  description(union_type_definition.description)
344
391
  possible_types(*union_type_definition.types.map { |type_name| type_resolver.call(type_name) })
@@ -347,27 +394,28 @@ module GraphQL
347
394
  end
348
395
  end
349
396
 
350
- def build_object_type(object_type_definition, type_resolver)
397
+ def build_object_type(object_type_definition, type_resolver, base_type)
351
398
  builder = self
352
399
 
353
- Class.new(GraphQL::Schema::Object) do
400
+ Class.new(base_type) do
354
401
  graphql_name(object_type_definition.name)
355
402
  description(object_type_definition.description)
356
403
  ast_node(object_type_definition)
357
404
  builder.build_directives(self, object_type_definition, type_resolver)
358
-
359
- object_type_definition.interfaces.each do |interface_name|
360
- interface_defn = type_resolver.call(interface_name)
361
- implements(interface_defn)
362
- end
363
-
405
+ builder.build_interfaces(self, object_type_definition.interfaces, type_resolver)
364
406
  builder.build_fields(self, object_type_definition.fields, type_resolver, default_resolve: true)
365
407
  end
366
408
  end
367
409
 
368
- def build_input_object_type(input_object_type_definition, type_resolver)
410
+ def build_interfaces(type_class, interface_names, type_resolver)
411
+ interface_names.each do |interface_name|
412
+ type_class.implements(type_resolver.call(interface_name))
413
+ end
414
+ end
415
+
416
+ def build_input_object_type(input_object_type_definition, type_resolver, base_type)
369
417
  builder = self
370
- Class.new(GraphQL::Schema::InputObject) do
418
+ Class.new(base_type) do
371
419
  graphql_name(input_object_type_definition.name)
372
420
  description(input_object_type_definition.description)
373
421
  ast_node(input_object_type_definition)
@@ -427,16 +475,13 @@ module GraphQL
427
475
  end
428
476
  end
429
477
 
430
- def build_interface_type(interface_type_definition, type_resolver)
478
+ def build_interface_type(interface_type_definition, type_resolver, base_type)
431
479
  builder = self
432
480
  Module.new do
433
- include GraphQL::Schema::Interface
481
+ include base_type
434
482
  graphql_name(interface_type_definition.name)
435
483
  description(interface_type_definition.description)
436
- interface_type_definition.interfaces.each do |interface_name|
437
- interface_defn = type_resolver.call(interface_name)
438
- implements(interface_defn)
439
- end
484
+ builder.build_interfaces(self, interface_type_definition.interfaces, type_resolver)
440
485
  ast_node(interface_type_definition)
441
486
  builder.build_directives(self, interface_type_definition, type_resolver)
442
487
 
@@ -64,14 +64,7 @@ module GraphQL
64
64
  end
65
65
 
66
66
  def prepare
67
- if @context
68
- object = @context[:current_object]
69
- # Pass this object's class with `as` so that messages are rendered correctly from inherited validators
70
- Schema::Validator.validate!(self.class.validators, object, @context, @ruby_style_hash, as: self.class)
71
- self
72
- else
73
- self
74
- end
67
+ self
75
68
  end
76
69
 
77
70
  def unwrap_value(value)
@@ -111,6 +104,14 @@ module GraphQL
111
104
  @ruby_style_hash.dup
112
105
  end
113
106
 
107
+ # @api private
108
+ def validate_for(context)
109
+ object = context[:current_object]
110
+ # Pass this object's class with `as` so that messages are rendered correctly from inherited validators
111
+ Schema::Validator.validate!(self.class.validators, object, context, @ruby_style_hash, as: self.class)
112
+ nil
113
+ end
114
+
114
115
  class << self
115
116
  def authorized?(obj, value, ctx)
116
117
  # Authorize each argument (but this doesn't apply if `prepare` is implemented):
@@ -111,7 +111,7 @@ module GraphQL
111
111
  # @param parser [Object] An object for handling definition string parsing (must respond to `parse`)
112
112
  # @param using [Hash] Plugins to attach to the created schema with `use(key, value)`
113
113
  # @return [Class] the schema described by `document`
114
- def from_definition(definition_or_path, default_resolve: nil, parser: GraphQL.default_parser, using: {})
114
+ def from_definition(definition_or_path, default_resolve: nil, parser: GraphQL.default_parser, using: {}, base_types: {})
115
115
  # If the file ends in `.graphql` or `.graphqls`, treat it like a filepath
116
116
  if definition_or_path.end_with?(".graphql") || definition_or_path.end_with?(".graphqls")
117
117
  GraphQL::Schema::BuildFromDefinition.from_definition_path(
@@ -120,6 +120,7 @@ module GraphQL
120
120
  default_resolve: default_resolve,
121
121
  parser: parser,
122
122
  using: using,
123
+ base_types: base_types,
123
124
  )
124
125
  else
125
126
  GraphQL::Schema::BuildFromDefinition.from_definition(
@@ -128,6 +129,7 @@ module GraphQL
128
129
  default_resolve: default_resolve,
129
130
  parser: parser,
130
131
  using: using,
132
+ base_types: base_types,
131
133
  )
132
134
  end
133
135
  end
@@ -43,18 +43,21 @@ module GraphQL
43
43
  type_name, *field_names = field_path.split(".")
44
44
  dummy_query = GraphQL::Query.new(schema, "{ __typename }", context: context)
45
45
  query_context = dummy_query.context
46
+ dataloader = query_context.dataloader
46
47
  object_type = dummy_query.types.type(type_name) # rubocop:disable Development/ContextIsPassedCop
47
48
  if object_type
48
49
  graphql_result = object
49
50
  field_names.each do |field_name|
50
51
  inner_object = graphql_result
51
- graphql_result = object_type.wrap(inner_object, query_context)
52
+ dataloader.run_isolated {
53
+ graphql_result = object_type.wrap(inner_object, query_context)
54
+ }
52
55
  if graphql_result.nil?
53
56
  return nil
54
57
  end
55
58
  visible_field = dummy_query.types.field(object_type, field_name) # rubocop:disable Development/ContextIsPassedCop
56
59
  if visible_field
57
- dummy_query.context.dataloader.run_isolated {
60
+ dataloader.run_isolated {
58
61
  query_context[:current_field] = visible_field
59
62
  field_args = visible_field.coerce_arguments(graphql_result, arguments, query_context)
60
63
  field_args = schema.sync_lazy(field_args)
@@ -63,6 +63,7 @@ module GraphQL
63
63
  # @param active_support_notifications_pattern [String, RegExp, false] A filter for `ActiveSupport::Notifications`, if it's present. Or `false` to skip subscribing.
64
64
  def initialize(active_support_notifications_pattern: nil, save_profile: false, **_rest)
65
65
  super
66
+ @active_support_notifications_pattern = active_support_notifications_pattern
66
67
  @save_profile = save_profile
67
68
  Fiber[:graphql_flow_stack] = nil
68
69
  @sequence_id = object_id
@@ -168,13 +169,12 @@ module GraphQL
168
169
  track_uuid: @fields_counter_id,
169
170
  counter_value: count_fields,
170
171
  )
171
-
172
- if defined?(ActiveSupport::Notifications) && active_support_notifications_pattern != false
173
- subscribe_to_active_support_notifications(active_support_notifications_pattern)
174
- end
175
172
  end
176
173
 
177
174
  def begin_execute_multiplex(m)
175
+ if defined?(ActiveSupport::Notifications) && @active_support_notifications_pattern != false
176
+ subscribe_to_active_support_notifications(@active_support_notifications_pattern)
177
+ end
178
178
  @operation_name = m.queries.map { |q| q.selected_operation_name || "anonymous" }.join(",")
179
179
  @begin_time = Time.now
180
180
  @packets << trace_packet(
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "2.4.14"
3
+ VERSION = "2.4.16"
4
4
  end
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.14
4
+ version: 2.4.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-03-13 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
@@ -248,34 +247,6 @@ dependencies:
248
247
  - - ">="
249
248
  - !ruby/object:Gem::Version
250
249
  version: '0'
251
- - !ruby/object:Gem::Dependency
252
- name: pronto
253
- requirement: !ruby/object:Gem::Requirement
254
- requirements:
255
- - - ">="
256
- - !ruby/object:Gem::Version
257
- version: '0'
258
- type: :development
259
- prerelease: false
260
- version_requirements: !ruby/object:Gem::Requirement
261
- requirements:
262
- - - ">="
263
- - !ruby/object:Gem::Version
264
- version: '0'
265
- - !ruby/object:Gem::Dependency
266
- name: pronto-undercover
267
- requirement: !ruby/object:Gem::Requirement
268
- requirements:
269
- - - ">="
270
- - !ruby/object:Gem::Version
271
- version: '0'
272
- type: :development
273
- prerelease: false
274
- version_requirements: !ruby/object:Gem::Requirement
275
- requirements:
276
- - - ">="
277
- - !ruby/object:Gem::Version
278
- version: '0'
279
250
  - !ruby/object:Gem::Dependency
280
251
  name: jekyll
281
252
  requirement: !ruby/object:Gem::Requirement
@@ -461,14 +432,33 @@ files:
461
432
  - lib/graphql/coercion_error.rb
462
433
  - lib/graphql/current.rb
463
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
464
439
  - lib/graphql/dashboard/statics/bootstrap-5.3.3.min.css
465
440
  - lib/graphql/dashboard/statics/bootstrap-5.3.3.min.js
441
+ - lib/graphql/dashboard/statics/charts.min.css
466
442
  - lib/graphql/dashboard/statics/dashboard.css
467
443
  - lib/graphql/dashboard/statics/dashboard.js
468
444
  - lib/graphql/dashboard/statics/header-icon.png
469
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
470
448
  - lib/graphql/dashboard/views/graphql/dashboard/landings/show.html.erb
471
- - lib/graphql/dashboard/views/graphql/dashboard/traces/index.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
472
462
  - lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb
473
463
  - lib/graphql/dataloader.rb
474
464
  - lib/graphql/dataloader/active_record_association_source.rb
@@ -795,7 +785,6 @@ metadata:
795
785
  bug_tracker_uri: https://github.com/rmosolgo/graphql-ruby/issues
796
786
  mailing_list_uri: https://buttondown.email/graphql-ruby
797
787
  rubygems_mfa_required: 'true'
798
- post_install_message:
799
788
  rdoc_options: []
800
789
  require_paths:
801
790
  - lib
@@ -810,8 +799,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
810
799
  - !ruby/object:Gem::Version
811
800
  version: '0'
812
801
  requirements: []
813
- rubygems_version: 3.1.6
814
- signing_key:
802
+ rubygems_version: 3.6.6
815
803
  specification_version: 4
816
804
  summary: A GraphQL language and runtime for Ruby
817
805
  test_files: []
@@ -1,63 +0,0 @@
1
- <% content_for(:title, "Profiles") %>
2
- <div class="row">
3
- <div class="col">
4
- <h1>Detailed Profiles</h1>
5
- </div>
6
- </div>
7
- <% if !@detailed_trace_installed %>
8
- <div class="row">
9
- <div class="col-md col-lg-6 mx-auto">
10
- <div class="card mt-4">
11
- <div class="card-body">
12
- <div class="card-title">
13
- <h3>
14
- Traces aren't installed yet
15
- </h3>
16
- </div>
17
- <p class="card-text">
18
- GraphQL-Ruby can instrument production traffic and save tracing artifacts here for later review.
19
- </p>
20
- <p class="card-text">
21
- Read more in <%= link_to "the tracing docs", "https://graphql-ruby.org/queries/tracing#detailed-traces" %>.
22
- </p>
23
- </div>
24
- </div>
25
- </div>
26
- </div>
27
- <% else %>
28
- <div class="row">
29
- <div class="col">
30
- <table class="table table-striped">
31
- <thead>
32
- <tr>
33
- <th>Operation</th>
34
- <th>Duration (ms) </th>
35
- <th>Timestamp</th>
36
- <th>Open in Perfetto UI</th>
37
- </tr>
38
- </thead>
39
- <tbody>
40
- <% if @traces.empty? %>
41
- <tr>
42
- <td colspan="4" class="text-center">
43
- <em>No traces saved yet. Read about saving traces <%= link_to "in the docs", "https://graphql-ruby.org/queries/tracing#detailed-profiles" %>.</em>
44
- </td>
45
- </tr>
46
- <% end %>
47
- <% @traces.each do |trace| %>
48
- <tr>
49
- <td><%= trace.operation_name %></td>
50
- <td><%= trace.duration_ms.round(2) %></td>
51
- <td><%= Time.at(trace.begin_ms / 1000.0).strftime("%Y-%m-%d %H:%M:%S.%L") %></td>
52
- <td><%= link_to "View ↗", "#", data: { perfetto_open: trace.operation_name, perfetto_path: "#{graphql_dashboard.traces_path}/#{trace.id}" } %></td>
53
- <td><%= link_to "Delete", "#", data: { perfetto_delete: "#{graphql_dashboard.traces_path}/#{trace.id}" }, class: "text-danger" %></td>
54
- </tr>
55
- <% end %>
56
- </tbody>
57
- </table>
58
- <% if @last && @traces.size >= @last %>
59
- <%= link_to("Previous >", graphql_dashboard.traces_path(last: @last, before: @traces.last.begin_ms), class: "btn btn-outline-primary") %>
60
- <% end %>
61
- </div>
62
- </div>
63
- <% end %>