graphql 2.5.14 → 2.5.22

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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/graphql/detailed_trace_generator.rb +77 -0
  3. data/lib/generators/graphql/templates/create_graphql_detailed_traces.erb +10 -0
  4. data/lib/graphql/dashboard/application_controller.rb +41 -0
  5. data/lib/graphql/dashboard/landings_controller.rb +9 -0
  6. data/lib/graphql/dashboard/statics_controller.rb +31 -0
  7. data/lib/graphql/dashboard/subscriptions.rb +2 -1
  8. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/_form.html.erb +1 -0
  9. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/edit.html.erb +2 -2
  10. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/index.html.erb +1 -1
  11. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/clients/new.html.erb +1 -1
  12. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/index_entries/index.html.erb +1 -1
  13. data/lib/graphql/dashboard/views/graphql/dashboard/operation_store/operations/show.html.erb +1 -1
  14. data/lib/graphql/dashboard/views/graphql/dashboard/subscriptions/topics/show.html.erb +1 -1
  15. data/lib/graphql/dashboard/views/layouts/graphql/dashboard/application.html.erb +7 -7
  16. data/lib/graphql/dashboard.rb +11 -73
  17. data/lib/graphql/dataloader/null_dataloader.rb +7 -3
  18. data/lib/graphql/date_encoding_error.rb +1 -1
  19. data/lib/graphql/execution/interpreter.rb +0 -1
  20. data/lib/graphql/execution/multiplex.rb +1 -1
  21. data/lib/graphql/execution/next/field_resolve_step.rb +711 -0
  22. data/lib/graphql/execution/next/load_argument_step.rb +60 -0
  23. data/lib/graphql/execution/next/prepare_object_step.rb +129 -0
  24. data/lib/graphql/execution/next/runner.rb +389 -0
  25. data/lib/graphql/execution/next/selections_step.rb +37 -0
  26. data/lib/graphql/execution/next.rb +70 -0
  27. data/lib/graphql/execution.rb +1 -0
  28. data/lib/graphql/execution_error.rb +13 -10
  29. data/lib/graphql/introspection/directive_type.rb +7 -3
  30. data/lib/graphql/introspection/dynamic_fields.rb +5 -1
  31. data/lib/graphql/introspection/entry_points.rb +11 -3
  32. data/lib/graphql/introspection/enum_value_type.rb +5 -5
  33. data/lib/graphql/introspection/field_type.rb +13 -5
  34. data/lib/graphql/introspection/input_value_type.rb +21 -13
  35. data/lib/graphql/introspection/type_type.rb +64 -28
  36. data/lib/graphql/invalid_null_error.rb +11 -5
  37. data/lib/graphql/language/document_from_schema_definition.rb +2 -1
  38. data/lib/graphql/language.rb +21 -12
  39. data/lib/graphql/pagination/connection.rb +2 -0
  40. data/lib/graphql/pagination/connections.rb +32 -0
  41. data/lib/graphql/query/context.rb +3 -2
  42. data/lib/graphql/query/null_context.rb +9 -3
  43. data/lib/graphql/schema/argument.rb +12 -0
  44. data/lib/graphql/schema/build_from_definition.rb +7 -0
  45. data/lib/graphql/schema/directive.rb +8 -1
  46. data/lib/graphql/schema/field/connection_extension.rb +15 -35
  47. data/lib/graphql/schema/field/scope_extension.rb +22 -13
  48. data/lib/graphql/schema/field.rb +80 -48
  49. data/lib/graphql/schema/field_extension.rb +33 -0
  50. data/lib/graphql/schema/member/base_dsl_methods.rb +1 -1
  51. data/lib/graphql/schema/member/has_arguments.rb +37 -14
  52. data/lib/graphql/schema/member/has_authorization.rb +35 -0
  53. data/lib/graphql/schema/member/has_dataloader.rb +37 -0
  54. data/lib/graphql/schema/member/has_fields.rb +81 -4
  55. data/lib/graphql/schema/member.rb +5 -0
  56. data/lib/graphql/schema/object.rb +1 -0
  57. data/lib/graphql/schema/resolver.rb +45 -1
  58. data/lib/graphql/schema/validator/required_validator.rb +33 -2
  59. data/lib/graphql/schema/visibility.rb +3 -3
  60. data/lib/graphql/schema.rb +53 -10
  61. data/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb +2 -2
  62. data/lib/graphql/subscriptions/action_cable_subscriptions.rb +1 -0
  63. data/lib/graphql/subscriptions.rb +1 -1
  64. data/lib/graphql/testing/mock_action_cable.rb +111 -0
  65. data/lib/graphql/testing.rb +1 -0
  66. data/lib/graphql/tracing/detailed_trace/active_record_backend.rb +74 -0
  67. data/lib/graphql/tracing/detailed_trace.rb +70 -7
  68. data/lib/graphql/tracing/perfetto_trace.rb +208 -78
  69. data/lib/graphql/types/relay/connection_behaviors.rb +8 -6
  70. data/lib/graphql/types/relay/edge_behaviors.rb +4 -3
  71. data/lib/graphql/types/relay/has_node_field.rb +13 -8
  72. data/lib/graphql/types/relay/has_nodes_field.rb +13 -8
  73. data/lib/graphql/types/relay/node_behaviors.rb +13 -2
  74. data/lib/graphql/unauthorized_error.rb +5 -1
  75. data/lib/graphql/version.rb +1 -1
  76. data/lib/graphql.rb +8 -2
  77. metadata +17 -3
@@ -4,7 +4,7 @@ module GraphQL
4
4
  # It's passed to {Schema.unauthorized_object}.
5
5
  #
6
6
  # Alternatively, custom code in `authorized?` may raise this error. It will be routed the same way.
7
- class UnauthorizedError < GraphQL::Error
7
+ class UnauthorizedError < GraphQL::RuntimeError
8
8
  # @return [Object] the application object that failed the authorization check
9
9
  attr_reader :object
10
10
 
@@ -19,11 +19,15 @@ module GraphQL
19
19
  raise ArgumentError, "#{self.class.name} requires either a message or keywords"
20
20
  end
21
21
 
22
+ @path = nil
22
23
  @object = object
23
24
  @type = type
24
25
  @context = context
26
+ @ast_nodes = nil
25
27
  message ||= "An instance of #{object.class} failed #{type.graphql_name}'s authorization check"
26
28
  super(message)
27
29
  end
30
+
31
+ attr_accessor :path, :ast_nodes
28
32
  end
29
33
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "2.5.14"
3
+ VERSION = "2.5.22"
4
4
  end
data/lib/graphql.rb CHANGED
@@ -4,7 +4,7 @@ require "json"
4
4
  require "set"
5
5
  require "singleton"
6
6
  require "forwardable"
7
- require "fiber/storage"
7
+ require "fiber/storage" if RUBY_VERSION < "3.2.0"
8
8
  require "graphql/autoload"
9
9
 
10
10
  module GraphQL
@@ -21,6 +21,9 @@ module GraphQL
21
21
  class Error < StandardError
22
22
  end
23
23
 
24
+ class RuntimeError < Error
25
+ end
26
+
24
27
  # This error is raised when GraphQL-Ruby encounters a situation
25
28
  # that it *thought* would never happen. Please report this bug!
26
29
  class InvariantError < Error
@@ -126,7 +129,10 @@ This is probably a bug in GraphQL-Ruby, please report this error on GitHub: http
126
129
  autoload :Testing, "graphql/testing"
127
130
  autoload :Current, "graphql/current"
128
131
  if defined?(::Rails::Engine)
129
- autoload :Dashboard, 'graphql/dashboard'
132
+ # This needs to be defined before Rails runs `add_routing_paths`,
133
+ # otherwise GraphQL::Dashboard's routes won't have been gathered for loading
134
+ # when that initializer runs.
135
+ require 'graphql/dashboard'
130
136
  end
131
137
  end
132
138
 
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.5.14
4
+ version: 2.5.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-10-08 00:00:00.000000000 Z
10
+ date: 2026-03-23 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: base64
@@ -383,6 +383,7 @@ files:
383
383
  - ".yardopts"
384
384
  - MIT-LICENSE
385
385
  - lib/generators/graphql/core.rb
386
+ - lib/generators/graphql/detailed_trace_generator.rb
386
387
  - lib/generators/graphql/enum_generator.rb
387
388
  - lib/generators/graphql/field_extractor.rb
388
389
  - lib/generators/graphql/input_generator.rb
@@ -412,6 +413,7 @@ files:
412
413
  - lib/generators/graphql/templates/base_resolver.erb
413
414
  - lib/generators/graphql/templates/base_scalar.erb
414
415
  - lib/generators/graphql/templates/base_union.erb
416
+ - lib/generators/graphql/templates/create_graphql_detailed_traces.erb
415
417
  - lib/generators/graphql/templates/enum.erb
416
418
  - lib/generators/graphql/templates/graphql_controller.erb
417
419
  - lib/generators/graphql/templates/input.erb
@@ -446,8 +448,10 @@ files:
446
448
  - lib/graphql/coercion_error.rb
447
449
  - lib/graphql/current.rb
448
450
  - lib/graphql/dashboard.rb
451
+ - lib/graphql/dashboard/application_controller.rb
449
452
  - lib/graphql/dashboard/detailed_traces.rb
450
453
  - lib/graphql/dashboard/installable.rb
454
+ - lib/graphql/dashboard/landings_controller.rb
451
455
  - lib/graphql/dashboard/limiters.rb
452
456
  - lib/graphql/dashboard/operation_store.rb
453
457
  - lib/graphql/dashboard/statics/bootstrap-5.3.3.min.css
@@ -457,6 +461,7 @@ files:
457
461
  - lib/graphql/dashboard/statics/dashboard.js
458
462
  - lib/graphql/dashboard/statics/header-icon.png
459
463
  - lib/graphql/dashboard/statics/icon.png
464
+ - lib/graphql/dashboard/statics_controller.rb
460
465
  - lib/graphql/dashboard/subscriptions.rb
461
466
  - lib/graphql/dashboard/views/graphql/dashboard/detailed_traces/traces/index.html.erb
462
467
  - lib/graphql/dashboard/views/graphql/dashboard/landings/show.html.erb
@@ -501,6 +506,12 @@ files:
501
506
  - lib/graphql/execution/lazy/lazy_method_map.rb
502
507
  - lib/graphql/execution/lookahead.rb
503
508
  - lib/graphql/execution/multiplex.rb
509
+ - lib/graphql/execution/next.rb
510
+ - lib/graphql/execution/next/field_resolve_step.rb
511
+ - lib/graphql/execution/next/load_argument_step.rb
512
+ - lib/graphql/execution/next/prepare_object_step.rb
513
+ - lib/graphql/execution/next/runner.rb
514
+ - lib/graphql/execution/next/selections_step.rb
504
515
  - lib/graphql/execution_error.rb
505
516
  - lib/graphql/integer_decoding_error.rb
506
517
  - lib/graphql/integer_encoding_error.rb
@@ -606,6 +617,7 @@ files:
606
617
  - lib/graphql/schema/member/graphql_type_names.rb
607
618
  - lib/graphql/schema/member/has_arguments.rb
608
619
  - lib/graphql/schema/member/has_ast_node.rb
620
+ - lib/graphql/schema/member/has_authorization.rb
609
621
  - lib/graphql/schema/member/has_dataloader.rb
610
622
  - lib/graphql/schema/member/has_deprecation_reason.rb
611
623
  - lib/graphql/schema/member/has_directives.rb
@@ -729,6 +741,7 @@ files:
729
741
  - lib/graphql/subscriptions/serialize.rb
730
742
  - lib/graphql/testing.rb
731
743
  - lib/graphql/testing/helpers.rb
744
+ - lib/graphql/testing/mock_action_cable.rb
732
745
  - lib/graphql/tracing.rb
733
746
  - lib/graphql/tracing/active_support_notifications_trace.rb
734
747
  - lib/graphql/tracing/active_support_notifications_tracing.rb
@@ -740,6 +753,7 @@ files:
740
753
  - lib/graphql/tracing/data_dog_trace.rb
741
754
  - lib/graphql/tracing/data_dog_tracing.rb
742
755
  - lib/graphql/tracing/detailed_trace.rb
756
+ - lib/graphql/tracing/detailed_trace/active_record_backend.rb
743
757
  - lib/graphql/tracing/detailed_trace/memory_backend.rb
744
758
  - lib/graphql/tracing/detailed_trace/redis_backend.rb
745
759
  - lib/graphql/tracing/legacy_hooks_trace.rb
@@ -817,7 +831,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
817
831
  - !ruby/object:Gem::Version
818
832
  version: '0'
819
833
  requirements: []
820
- rubygems_version: 3.6.2
834
+ rubygems_version: 4.0.8
821
835
  specification_version: 4
822
836
  summary: A GraphQL language and runtime for Ruby
823
837
  test_files: []