graphql 2.0.28 → 2.2.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/graphql/install/templates/base_mutation.erb +2 -0
  3. data/lib/generators/graphql/install/templates/mutation_type.erb +2 -0
  4. data/lib/generators/graphql/install_generator.rb +3 -0
  5. data/lib/generators/graphql/templates/base_argument.erb +2 -0
  6. data/lib/generators/graphql/templates/base_connection.erb +2 -0
  7. data/lib/generators/graphql/templates/base_edge.erb +2 -0
  8. data/lib/generators/graphql/templates/base_enum.erb +2 -0
  9. data/lib/generators/graphql/templates/base_field.erb +2 -0
  10. data/lib/generators/graphql/templates/base_input_object.erb +2 -0
  11. data/lib/generators/graphql/templates/base_interface.erb +2 -0
  12. data/lib/generators/graphql/templates/base_object.erb +2 -0
  13. data/lib/generators/graphql/templates/base_resolver.erb +6 -0
  14. data/lib/generators/graphql/templates/base_scalar.erb +2 -0
  15. data/lib/generators/graphql/templates/base_union.erb +2 -0
  16. data/lib/generators/graphql/templates/graphql_controller.erb +2 -0
  17. data/lib/generators/graphql/templates/loader.erb +2 -0
  18. data/lib/generators/graphql/templates/mutation.erb +2 -0
  19. data/lib/generators/graphql/templates/node_type.erb +2 -0
  20. data/lib/generators/graphql/templates/query_type.erb +2 -0
  21. data/lib/generators/graphql/templates/schema.erb +2 -0
  22. data/lib/graphql/analysis/ast/analyzer.rb +7 -0
  23. data/lib/graphql/analysis/ast/field_usage.rb +32 -7
  24. data/lib/graphql/analysis/ast/query_complexity.rb +80 -128
  25. data/lib/graphql/analysis/ast/query_depth.rb +7 -2
  26. data/lib/graphql/analysis/ast/visitor.rb +2 -2
  27. data/lib/graphql/analysis/ast.rb +21 -11
  28. data/lib/graphql/backtrace/trace.rb +12 -15
  29. data/lib/graphql/coercion_error.rb +1 -9
  30. data/lib/graphql/dataloader/async_dataloader.rb +85 -0
  31. data/lib/graphql/dataloader/request.rb +5 -0
  32. data/lib/graphql/dataloader/source.rb +11 -3
  33. data/lib/graphql/dataloader.rb +109 -142
  34. data/lib/graphql/duration_encoding_error.rb +16 -0
  35. data/lib/graphql/execution/interpreter/runtime/graphql_result.rb +170 -0
  36. data/lib/graphql/execution/interpreter/runtime.rb +79 -248
  37. data/lib/graphql/execution/interpreter.rb +91 -157
  38. data/lib/graphql/execution/lookahead.rb +88 -21
  39. data/lib/graphql/introspection/dynamic_fields.rb +1 -1
  40. data/lib/graphql/introspection/entry_points.rb +11 -5
  41. data/lib/graphql/introspection/schema_type.rb +3 -1
  42. data/lib/graphql/language/block_string.rb +34 -18
  43. data/lib/graphql/language/definition_slice.rb +1 -1
  44. data/lib/graphql/language/document_from_schema_definition.rb +37 -37
  45. data/lib/graphql/language/lexer.rb +271 -177
  46. data/lib/graphql/language/nodes.rb +75 -57
  47. data/lib/graphql/language/parser.rb +707 -1986
  48. data/lib/graphql/language/printer.rb +303 -146
  49. data/lib/graphql/language/sanitized_printer.rb +20 -22
  50. data/lib/graphql/language/static_visitor.rb +167 -0
  51. data/lib/graphql/language/visitor.rb +20 -81
  52. data/lib/graphql/language.rb +1 -0
  53. data/lib/graphql/load_application_object_failed_error.rb +5 -1
  54. data/lib/graphql/pagination/array_connection.rb +3 -3
  55. data/lib/graphql/pagination/connection.rb +28 -1
  56. data/lib/graphql/pagination/mongoid_relation_connection.rb +1 -2
  57. data/lib/graphql/pagination/relation_connection.rb +3 -3
  58. data/lib/graphql/query/context/scoped_context.rb +101 -0
  59. data/lib/graphql/query/context.rb +36 -98
  60. data/lib/graphql/query/null_context.rb +4 -11
  61. data/lib/graphql/query/validation_pipeline.rb +2 -2
  62. data/lib/graphql/query/variables.rb +3 -3
  63. data/lib/graphql/query.rb +13 -22
  64. data/lib/graphql/railtie.rb +9 -6
  65. data/lib/graphql/rake_task.rb +3 -12
  66. data/lib/graphql/schema/argument.rb +6 -1
  67. data/lib/graphql/schema/base_64_encoder.rb +3 -5
  68. data/lib/graphql/schema/build_from_definition.rb +0 -11
  69. data/lib/graphql/schema/directive/one_of.rb +12 -0
  70. data/lib/graphql/schema/directive/specified_by.rb +14 -0
  71. data/lib/graphql/schema/directive.rb +1 -1
  72. data/lib/graphql/schema/enum.rb +3 -3
  73. data/lib/graphql/schema/field/connection_extension.rb +1 -15
  74. data/lib/graphql/schema/field/scope_extension.rb +8 -1
  75. data/lib/graphql/schema/field.rb +39 -35
  76. data/lib/graphql/schema/has_single_input_argument.rb +156 -0
  77. data/lib/graphql/schema/input_object.rb +2 -2
  78. data/lib/graphql/schema/interface.rb +15 -11
  79. data/lib/graphql/schema/introspection_system.rb +2 -0
  80. data/lib/graphql/schema/loader.rb +0 -2
  81. data/lib/graphql/schema/member/base_dsl_methods.rb +2 -1
  82. data/lib/graphql/schema/member/has_arguments.rb +61 -38
  83. data/lib/graphql/schema/member/has_fields.rb +8 -5
  84. data/lib/graphql/schema/member/has_interfaces.rb +23 -9
  85. data/lib/graphql/schema/member/scoped.rb +19 -0
  86. data/lib/graphql/schema/member/validates_input.rb +3 -3
  87. data/lib/graphql/schema/object.rb +8 -0
  88. data/lib/graphql/schema/printer.rb +8 -7
  89. data/lib/graphql/schema/relay_classic_mutation.rb +6 -128
  90. data/lib/graphql/schema/resolver.rb +16 -8
  91. data/lib/graphql/schema/scalar.rb +3 -3
  92. data/lib/graphql/schema/subscription.rb +11 -4
  93. data/lib/graphql/schema/union.rb +1 -1
  94. data/lib/graphql/schema/unique_within_type.rb +1 -1
  95. data/lib/graphql/schema/warden.rb +96 -94
  96. data/lib/graphql/schema.rb +252 -78
  97. data/lib/graphql/static_validation/all_rules.rb +1 -1
  98. data/lib/graphql/static_validation/base_visitor.rb +1 -1
  99. data/lib/graphql/static_validation/literal_validator.rb +2 -3
  100. data/lib/graphql/static_validation/rules/fields_will_merge.rb +1 -1
  101. data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +1 -1
  102. data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb +2 -2
  103. data/lib/graphql/static_validation/validation_context.rb +5 -5
  104. data/lib/graphql/static_validation/validator.rb +3 -0
  105. data/lib/graphql/static_validation.rb +0 -1
  106. data/lib/graphql/subscriptions/action_cable_subscriptions.rb +3 -2
  107. data/lib/graphql/subscriptions/event.rb +8 -2
  108. data/lib/graphql/subscriptions/serialize.rb +2 -0
  109. data/lib/graphql/subscriptions.rb +14 -12
  110. data/lib/graphql/testing/helpers.rb +129 -0
  111. data/lib/graphql/testing.rb +2 -0
  112. data/lib/graphql/tracing/appoptics_trace.rb +2 -2
  113. data/lib/graphql/tracing/appoptics_tracing.rb +2 -2
  114. data/lib/graphql/tracing/legacy_hooks_trace.rb +74 -0
  115. data/lib/graphql/tracing/platform_tracing.rb +2 -0
  116. data/lib/graphql/tracing/{prometheus_tracing → prometheus_trace}/graphql_collector.rb +3 -1
  117. data/lib/graphql/tracing/sentry_trace.rb +112 -0
  118. data/lib/graphql/tracing/trace.rb +1 -0
  119. data/lib/graphql/tracing.rb +3 -1
  120. data/lib/graphql/types/iso_8601_duration.rb +77 -0
  121. data/lib/graphql/types/relay/connection_behaviors.rb +32 -2
  122. data/lib/graphql/types/relay/edge_behaviors.rb +7 -0
  123. data/lib/graphql/types.rb +1 -0
  124. data/lib/graphql/version.rb +1 -1
  125. data/lib/graphql.rb +6 -5
  126. data/readme.md +12 -2
  127. metadata +46 -38
  128. data/lib/graphql/deprecation.rb +0 -9
  129. data/lib/graphql/filter.rb +0 -59
  130. data/lib/graphql/language/parser.y +0 -560
  131. data/lib/graphql/schema/base_64_bp.rb +0 -26
  132. data/lib/graphql/static_validation/type_stack.rb +0 -216
  133. data/lib/graphql/subscriptions/instrumentation.rb +0 -28
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+ module GraphQL
3
+ module Types
4
+ # This scalar takes `Duration`s and transmits them as strings,
5
+ # using ISO 8601 format. ActiveSupport >= 5.0 must be loaded to use
6
+ # this scalar.
7
+ #
8
+ # Use it for fields or arguments as follows:
9
+ #
10
+ # field :age, GraphQL::Types::ISO8601Duration, null: false
11
+ #
12
+ # argument :interval, GraphQL::Types::ISO8601Duration, null: false
13
+ #
14
+ # Alternatively, use this built-in scalar as inspiration for your
15
+ # own Duration type.
16
+ class ISO8601Duration < GraphQL::Schema::Scalar
17
+ description "An ISO 8601-encoded duration"
18
+
19
+ # @return [Integer, nil]
20
+ def self.seconds_precision
21
+ # ActiveSupport::Duration precision defaults to whatever input was given
22
+ @seconds_precision
23
+ end
24
+
25
+ # @param [Integer, nil] value
26
+ def self.seconds_precision=(value)
27
+ @seconds_precision = value
28
+ end
29
+
30
+ # @param value [ActiveSupport::Duration, String]
31
+ # @return [String]
32
+ # @raise [GraphQL::Error] if ActiveSupport::Duration is not defined or if an incompatible object is passed
33
+ def self.coerce_result(value, _ctx)
34
+ unless defined?(ActiveSupport::Duration)
35
+ raise GraphQL::Error, "ActiveSupport >= 5.0 must be loaded to use the built-in ISO8601Duration type."
36
+ end
37
+
38
+ begin
39
+ case value
40
+ when ActiveSupport::Duration
41
+ value.iso8601(precision: seconds_precision)
42
+ when ::String
43
+ ActiveSupport::Duration.parse(value).iso8601(precision: seconds_precision)
44
+ else
45
+ # Try calling as ActiveSupport::Duration compatible as a fallback
46
+ value.iso8601(precision: seconds_precision)
47
+ end
48
+ rescue StandardError => error
49
+ raise GraphQL::Error, "An incompatible object (#{value.class}) was given to #{self}. Make sure that only ActiveSupport::Durations and well-formatted Strings are used with this type. (#{error.message})"
50
+ end
51
+ end
52
+
53
+ # @param value [String, ActiveSupport::Duration]
54
+ # @return [ActiveSupport::Duration, nil]
55
+ # @raise [GraphQL::Error] if ActiveSupport::Duration is not defined
56
+ # @raise [GraphQL::DurationEncodingError] if duration cannot be parsed
57
+ def self.coerce_input(value, ctx)
58
+ unless defined?(ActiveSupport::Duration)
59
+ raise GraphQL::Error, "ActiveSupport >= 5.0 must be loaded to use the built-in ISO8601Duration type."
60
+ end
61
+
62
+ begin
63
+ if value.is_a?(ActiveSupport::Duration)
64
+ value
65
+ elsif value.nil?
66
+ nil
67
+ else
68
+ ActiveSupport::Duration.parse(value)
69
+ end
70
+ rescue ArgumentError, TypeError
71
+ err = GraphQL::DurationEncodingError.new(value)
72
+ ctx.schema.type_error(err, ctx)
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -67,9 +67,8 @@ module GraphQL
67
67
  type: [edge_type_class, null: edge_nullable],
68
68
  null: edges_nullable,
69
69
  description: "A list of edges.",
70
+ scope: false, # Assume that the connection was already scoped.
70
71
  connection: false,
71
- # Assume that the connection was scoped before this step:
72
- scope: false,
73
72
  }
74
73
 
75
74
  if field_options
@@ -88,6 +87,19 @@ module GraphQL
88
87
  node_type.scope_items(items, context)
89
88
  end
90
89
 
90
+ # The connection will skip auth on its nodes if the node_type is configured for that
91
+ def reauthorize_scoped_objects(new_value = nil)
92
+ if new_value.nil?
93
+ if @reauthorize_scoped_objects != nil
94
+ @reauthorize_scoped_objects
95
+ else
96
+ node_type.reauthorize_scoped_objects
97
+ end
98
+ else
99
+ @reauthorize_scoped_objects = new_value
100
+ end
101
+ end
102
+
91
103
  # Add the shortcut `nodes` field to this connection and its subclasses
92
104
  def nodes_field(node_nullable: self.node_nullable, field_options: nil)
93
105
  define_nodes_field(node_nullable, field_options: field_options)
@@ -170,6 +182,24 @@ module GraphQL
170
182
  obj_type.field :page_info, GraphQL::Types::Relay::PageInfo, null: false, description: "Information to aid in pagination."
171
183
  end
172
184
  end
185
+
186
+ def edges
187
+ # Assume that whatever authorization needed to happen
188
+ # already happened at the connection level.
189
+ current_runtime_state = Thread.current[:__graphql_runtime_info]
190
+ query_runtime_state = current_runtime_state[context.query]
191
+ query_runtime_state.was_authorized_by_scope_items = @object.was_authorized_by_scope_items?
192
+ @object.edges
193
+ end
194
+
195
+ def nodes
196
+ # Assume that whatever authorization needed to happen
197
+ # already happened at the connection level.
198
+ current_runtime_state = Thread.current[:__graphql_runtime_info]
199
+ query_runtime_state = current_runtime_state[context.query]
200
+ query_runtime_state.was_authorized_by_scope_items = @object.was_authorized_by_scope_items?
201
+ @object.nodes
202
+ end
173
203
  end
174
204
  end
175
205
  end
@@ -12,6 +12,13 @@ module GraphQL
12
12
  child_class.node_nullable(true)
13
13
  end
14
14
 
15
+ def node
16
+ current_runtime_state = Thread.current[:__graphql_runtime_info]
17
+ query_runtime_state = current_runtime_state[context.query]
18
+ query_runtime_state.was_authorized_by_scope_items = @object.was_authorized_by_scope_items?
19
+ @object.node
20
+ end
21
+
15
22
  module ClassMethods
16
23
  def inherited(child_class)
17
24
  super
data/lib/graphql/types.rb CHANGED
@@ -6,6 +6,7 @@ require "graphql/types/id"
6
6
  require "graphql/types/int"
7
7
  require "graphql/types/iso_8601_date"
8
8
  require "graphql/types/iso_8601_date_time"
9
+ require "graphql/types/iso_8601_duration"
9
10
  require "graphql/types/json"
10
11
  require "graphql/types/string"
11
12
  require "graphql/types/relay"
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "2.0.28"
3
+ VERSION = "2.2.11"
4
4
  end
data/lib/graphql.rb CHANGED
@@ -42,8 +42,8 @@ This is probably a bug in GraphQL-Ruby, please report this error on GitHub: http
42
42
  # Turn a query string or schema definition into an AST
43
43
  # @param graphql_string [String] a GraphQL query string or schema definition
44
44
  # @return [GraphQL::Language::Nodes::Document]
45
- def self.parse(graphql_string, trace: GraphQL::Tracing::NullTrace)
46
- default_parser.parse(graphql_string, trace: trace)
45
+ def self.parse(graphql_string, trace: GraphQL::Tracing::NullTrace, filename: nil)
46
+ default_parser.parse(graphql_string, trace: trace, filename: filename)
47
47
  end
48
48
 
49
49
  # Read the contents of `filename` and parse them as GraphQL
@@ -60,6 +60,7 @@ This is probably a bug in GraphQL-Ruby, please report this error on GitHub: http
60
60
  end
61
61
 
62
62
  def self.parse_with_racc(string, filename: nil, trace: GraphQL::Tracing::NullTrace)
63
+ warn "`GraphQL.parse_with_racc` is deprecated; GraphQL-Ruby no longer uses racc for parsing. Call `GraphQL.parse` or `GraphQL::Language::Parser.parse` instead."
63
64
  GraphQL::Language::Parser.parse(string, filename: filename, trace: trace)
64
65
  end
65
66
 
@@ -88,6 +89,7 @@ require "graphql/integer_decoding_error"
88
89
  require "graphql/integer_encoding_error"
89
90
  require "graphql/string_encoding_error"
90
91
  require "graphql/date_encoding_error"
92
+ require "graphql/duration_encoding_error"
91
93
  require "graphql/type_kinds"
92
94
  require "graphql/name_validator"
93
95
  require "graphql/language"
@@ -101,9 +103,8 @@ require "graphql/execution"
101
103
  require "graphql/pagination"
102
104
  require "graphql/schema"
103
105
  require "graphql/query"
104
- require "graphql/types"
105
106
  require "graphql/dataloader"
106
- require "graphql/filter"
107
+ require "graphql/types"
107
108
  require "graphql/static_validation"
108
109
  require "graphql/execution"
109
110
  require "graphql/schema/built_in_types"
@@ -120,4 +121,4 @@ require "graphql/backtrace"
120
121
  require "graphql/unauthorized_error"
121
122
  require "graphql/unauthorized_field_error"
122
123
  require "graphql/load_application_object_failed_error"
123
- require "graphql/deprecation"
124
+ require "graphql/testing"
data/readme.md CHANGED
@@ -7,7 +7,7 @@ A Ruby implementation of [GraphQL](https://graphql.org/).
7
7
 
8
8
  - [Website](https://graphql-ruby.org/)
9
9
  - [API Documentation](https://www.rubydoc.info/github/rmosolgo/graphql-ruby)
10
- - [Newsletter](https://tinyletter.com/graphql-ruby)
10
+ - [Newsletter](https://buttondown.email/graphql-ruby)
11
11
 
12
12
  ## Installation
13
13
 
@@ -34,7 +34,17 @@ Or, see ["Getting Started"](https://graphql-ruby.org/getting_started.html).
34
34
 
35
35
  ## Upgrade
36
36
 
37
- I also sell [GraphQL::Pro](https://graphql.pro) which provides several features on top of the GraphQL runtime, including [Pundit authorization](https://graphql-ruby.org/authorization/pundit_integration), [CanCan authorization](https://graphql-ruby.org/authorization/can_can_integration), [Pusher-based subscriptions](https://graphql-ruby.org/subscriptions/pusher_implementation) and [persisted queries](https://graphql-ruby.org/operation_store/overview). Besides that, Pro customers get email support and an opportunity to support graphql-ruby's development!
37
+ I also sell [GraphQL::Pro](https://graphql.pro) which provides several features on top of the GraphQL runtime, including:
38
+
39
+ - [Persisted queries](https://graphql-ruby.org/operation_store/overview)
40
+ - [API versioning](https://graphql-ruby.org/changesets/overview)
41
+ - [Streaming payloads](https://graphql-ruby.org/defer/overview)
42
+ - [Server-side caching](https://graphql-ruby.org/object_cache/overview)
43
+ - [Rate limiters](https://graphql-ruby.org/limiters/overview)
44
+ - Subscriptions backends for [Pusher](https://graphql-ruby.org/subscriptions/pusher_implementation) and [Ably](https://graphql-ruby.org/subscriptions/ably_implementation)
45
+ - Authorization plugins for [Pundit](https://graphql-ruby.org/authorization/pundit_integration) and [CanCan](https://graphql-ruby.org/authorization/can_can_integration)
46
+
47
+ Besides that, Pro customers get email support and an opportunity to support graphql-ruby's development!
38
48
 
39
49
  ## Goals
40
50
 
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.28
4
+ version: 2.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-25 00:00:00.000000000 Z
11
+ date: 2024-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: base64
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: benchmark-ips
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -56,58 +70,44 @@ dependencies:
56
70
  name: minitest
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - "~>"
73
+ - - ">="
60
74
  - !ruby/object:Gem::Version
61
- version: 5.9.0
75
+ version: '0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - "~>"
80
+ - - ">="
67
81
  - !ruby/object:Gem::Version
68
- version: 5.9.0
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: minitest-focus
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - "~>"
87
+ - - ">="
74
88
  - !ruby/object:Gem::Version
75
- version: '1.1'
89
+ version: '0'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - "~>"
94
+ - - ">="
81
95
  - !ruby/object:Gem::Version
82
- version: '1.1'
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: minitest-reporters
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '1.0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '1.0'
97
- - !ruby/object:Gem::Dependency
98
- name: racc
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '1.4'
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: '1.4'
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -270,6 +270,7 @@ files:
270
270
  - lib/generators/graphql/templates/base_input_object.erb
271
271
  - lib/generators/graphql/templates/base_interface.erb
272
272
  - lib/generators/graphql/templates/base_object.erb
273
+ - lib/generators/graphql/templates/base_resolver.erb
273
274
  - lib/generators/graphql/templates/base_scalar.erb
274
275
  - lib/generators/graphql/templates/base_union.erb
275
276
  - lib/generators/graphql/templates/enum.erb
@@ -308,13 +309,14 @@ files:
308
309
  - lib/graphql/backtrace/tracer.rb
309
310
  - lib/graphql/coercion_error.rb
310
311
  - lib/graphql/dataloader.rb
312
+ - lib/graphql/dataloader/async_dataloader.rb
311
313
  - lib/graphql/dataloader/null_dataloader.rb
312
314
  - lib/graphql/dataloader/request.rb
313
315
  - lib/graphql/dataloader/request_all.rb
314
316
  - lib/graphql/dataloader/source.rb
315
317
  - lib/graphql/date_encoding_error.rb
316
- - lib/graphql/deprecation.rb
317
318
  - lib/graphql/dig.rb
319
+ - lib/graphql/duration_encoding_error.rb
318
320
  - lib/graphql/execution.rb
319
321
  - lib/graphql/execution/directive_checks.rb
320
322
  - lib/graphql/execution/errors.rb
@@ -326,12 +328,12 @@ files:
326
328
  - lib/graphql/execution/interpreter/handles_raw_value.rb
327
329
  - lib/graphql/execution/interpreter/resolve.rb
328
330
  - lib/graphql/execution/interpreter/runtime.rb
331
+ - lib/graphql/execution/interpreter/runtime/graphql_result.rb
329
332
  - lib/graphql/execution/lazy.rb
330
333
  - lib/graphql/execution/lazy/lazy_method_map.rb
331
334
  - lib/graphql/execution/lookahead.rb
332
335
  - lib/graphql/execution/multiplex.rb
333
336
  - lib/graphql/execution_error.rb
334
- - lib/graphql/filter.rb
335
337
  - lib/graphql/integer_decoding_error.rb
336
338
  - lib/graphql/integer_encoding_error.rb
337
339
  - lib/graphql/introspection.rb
@@ -358,9 +360,9 @@ files:
358
360
  - lib/graphql/language/lexer.rb
359
361
  - lib/graphql/language/nodes.rb
360
362
  - lib/graphql/language/parser.rb
361
- - lib/graphql/language/parser.y
362
363
  - lib/graphql/language/printer.rb
363
364
  - lib/graphql/language/sanitized_printer.rb
365
+ - lib/graphql/language/static_visitor.rb
364
366
  - lib/graphql/language/token.rb
365
367
  - lib/graphql/language/visitor.rb
366
368
  - lib/graphql/load_application_object_failed_error.rb
@@ -376,6 +378,7 @@ files:
376
378
  - lib/graphql/parse_error.rb
377
379
  - lib/graphql/query.rb
378
380
  - lib/graphql/query/context.rb
381
+ - lib/graphql/query/context/scoped_context.rb
379
382
  - lib/graphql/query/fingerprint.rb
380
383
  - lib/graphql/query/input_validation_result.rb
381
384
  - lib/graphql/query/null_context.rb
@@ -397,7 +400,6 @@ files:
397
400
  - lib/graphql/schema/addition.rb
398
401
  - lib/graphql/schema/always_visible.rb
399
402
  - lib/graphql/schema/argument.rb
400
- - lib/graphql/schema/base_64_bp.rb
401
403
  - lib/graphql/schema/base_64_encoder.rb
402
404
  - lib/graphql/schema/build_from_definition.rb
403
405
  - lib/graphql/schema/build_from_definition/resolve_map.rb
@@ -410,6 +412,7 @@ files:
410
412
  - lib/graphql/schema/directive/include.rb
411
413
  - lib/graphql/schema/directive/one_of.rb
412
414
  - lib/graphql/schema/directive/skip.rb
415
+ - lib/graphql/schema/directive/specified_by.rb
413
416
  - lib/graphql/schema/directive/transform.rb
414
417
  - lib/graphql/schema/enum.rb
415
418
  - lib/graphql/schema/enum_value.rb
@@ -419,6 +422,7 @@ files:
419
422
  - lib/graphql/schema/field_extension.rb
420
423
  - lib/graphql/schema/find_inherited_value.rb
421
424
  - lib/graphql/schema/finder.rb
425
+ - lib/graphql/schema/has_single_input_argument.rb
422
426
  - lib/graphql/schema/input_object.rb
423
427
  - lib/graphql/schema/interface.rb
424
428
  - lib/graphql/schema/introspection_system.rb
@@ -536,7 +540,6 @@ files:
536
540
  - lib/graphql/static_validation/rules/variables_are_input_types_error.rb
537
541
  - lib/graphql/static_validation/rules/variables_are_used_and_defined.rb
538
542
  - lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb
539
- - lib/graphql/static_validation/type_stack.rb
540
543
  - lib/graphql/static_validation/validation_context.rb
541
544
  - lib/graphql/static_validation/validation_timeout_error.rb
542
545
  - lib/graphql/static_validation/validator.rb
@@ -546,8 +549,9 @@ files:
546
549
  - lib/graphql/subscriptions/broadcast_analyzer.rb
547
550
  - lib/graphql/subscriptions/default_subscription_resolve_extension.rb
548
551
  - lib/graphql/subscriptions/event.rb
549
- - lib/graphql/subscriptions/instrumentation.rb
550
552
  - lib/graphql/subscriptions/serialize.rb
553
+ - lib/graphql/testing.rb
554
+ - lib/graphql/testing/helpers.rb
551
555
  - lib/graphql/tracing.rb
552
556
  - lib/graphql/tracing/active_support_notifications_trace.rb
553
557
  - lib/graphql/tracing/active_support_notifications_tracing.rb
@@ -557,6 +561,7 @@ files:
557
561
  - lib/graphql/tracing/appsignal_tracing.rb
558
562
  - lib/graphql/tracing/data_dog_trace.rb
559
563
  - lib/graphql/tracing/data_dog_tracing.rb
564
+ - lib/graphql/tracing/legacy_hooks_trace.rb
560
565
  - lib/graphql/tracing/legacy_trace.rb
561
566
  - lib/graphql/tracing/new_relic_trace.rb
562
567
  - lib/graphql/tracing/new_relic_tracing.rb
@@ -565,10 +570,11 @@ files:
565
570
  - lib/graphql/tracing/platform_trace.rb
566
571
  - lib/graphql/tracing/platform_tracing.rb
567
572
  - lib/graphql/tracing/prometheus_trace.rb
573
+ - lib/graphql/tracing/prometheus_trace/graphql_collector.rb
568
574
  - lib/graphql/tracing/prometheus_tracing.rb
569
- - lib/graphql/tracing/prometheus_tracing/graphql_collector.rb
570
575
  - lib/graphql/tracing/scout_trace.rb
571
576
  - lib/graphql/tracing/scout_tracing.rb
577
+ - lib/graphql/tracing/sentry_trace.rb
572
578
  - lib/graphql/tracing/statsd_trace.rb
573
579
  - lib/graphql/tracing/statsd_tracing.rb
574
580
  - lib/graphql/tracing/trace.rb
@@ -581,6 +587,7 @@ files:
581
587
  - lib/graphql/types/int.rb
582
588
  - lib/graphql/types/iso_8601_date.rb
583
589
  - lib/graphql/types/iso_8601_date_time.rb
590
+ - lib/graphql/types/iso_8601_duration.rb
584
591
  - lib/graphql/types/json.rb
585
592
  - lib/graphql/types/relay.rb
586
593
  - lib/graphql/types/relay/base_connection.rb
@@ -607,7 +614,8 @@ metadata:
607
614
  changelog_uri: https://github.com/rmosolgo/graphql-ruby/blob/master/CHANGELOG.md
608
615
  source_code_uri: https://github.com/rmosolgo/graphql-ruby
609
616
  bug_tracker_uri: https://github.com/rmosolgo/graphql-ruby/issues
610
- mailing_list_uri: https://tinyletter.com/graphql-ruby
617
+ mailing_list_uri: https://buttondown.email/graphql-ruby
618
+ rubygems_mfa_required: 'true'
611
619
  post_install_message:
612
620
  rdoc_options: []
613
621
  require_paths:
@@ -616,14 +624,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
616
624
  requirements:
617
625
  - - ">="
618
626
  - !ruby/object:Gem::Version
619
- version: 2.4.0
627
+ version: 2.7.0
620
628
  required_rubygems_version: !ruby/object:Gem::Requirement
621
629
  requirements:
622
630
  - - ">="
623
631
  - !ruby/object:Gem::Version
624
632
  version: '0'
625
633
  requirements: []
626
- rubygems_version: 3.5.5
634
+ rubygems_version: 3.5.3
627
635
  signing_key:
628
636
  specification_version: 4
629
637
  summary: A GraphQL language and runtime for Ruby
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module GraphQL
4
- module Deprecation
5
- def self.warn(message)
6
- Kernel.warn(message)
7
- end
8
- end
9
- end
@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
- require "graphql/deprecation"
3
-
4
- module GraphQL
5
- # @api private
6
- class Filter
7
- def initialize(only: nil, except: nil, silence_deprecation_warning: false)
8
- if !silence_deprecation_warning
9
- line = caller(2, 10).find { |l| !l.include?("lib/graphql") }
10
- GraphQL::Deprecation.warn("GraphQL::Filter, `only:`, `except:`, and `.merge_filters` are deprecated and will be removed in v2.1.0. Implement `visible?` on your schema members instead (https://graphql-ruby.org/authorization/visibility.html).\n #{line}")
11
- end
12
- @only = only
13
- @except = except
14
- end
15
-
16
- # Returns true if `member, ctx` passes this filter
17
- def call(member, ctx)
18
- (@only ? @only.call(member, ctx) : true) &&
19
- (@except ? !@except.call(member, ctx) : true)
20
- end
21
-
22
- def merge(only: nil, except: nil)
23
- onlies = [self].concat(Array(only))
24
- merged_only = MergedOnly.build(onlies)
25
- merged_except = MergedExcept.build(Array(except))
26
- self.class.new(only: merged_only, except: merged_except, silence_deprecation_warning: true)
27
- end
28
-
29
- private
30
-
31
- class MergedOnly
32
- def initialize(first, second)
33
- @first = first
34
- @second = second
35
- end
36
-
37
- def call(member, ctx)
38
- @first.call(member, ctx) && @second.call(member, ctx)
39
- end
40
-
41
- def self.build(onlies)
42
- case onlies.size
43
- when 0
44
- nil
45
- when 1
46
- onlies[0]
47
- else
48
- onlies.reduce { |memo, only| self.new(memo, only) }
49
- end
50
- end
51
- end
52
-
53
- class MergedExcept < MergedOnly
54
- def call(member, ctx)
55
- @first.call(member, ctx) || @second.call(member, ctx)
56
- end
57
- end
58
- end
59
- end