graphql 2.3.6 → 2.3.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/lib/graphql/analysis/field_usage.rb +1 -1
  3. data/lib/graphql/analysis/query_complexity.rb +3 -3
  4. data/lib/graphql/analysis/visitor.rb +7 -6
  5. data/lib/graphql/execution/interpreter/runtime.rb +6 -6
  6. data/lib/graphql/execution/lookahead.rb +10 -10
  7. data/lib/graphql/introspection/directive_type.rb +1 -1
  8. data/lib/graphql/introspection/entry_points.rb +2 -2
  9. data/lib/graphql/introspection/field_type.rb +1 -1
  10. data/lib/graphql/introspection/schema_type.rb +13 -3
  11. data/lib/graphql/introspection/type_type.rb +5 -5
  12. data/lib/graphql/language/document_from_schema_definition.rb +19 -26
  13. data/lib/graphql/language/lexer.rb +0 -3
  14. data/lib/graphql/language/sanitized_printer.rb +1 -1
  15. data/lib/graphql/language.rb +0 -1
  16. data/lib/graphql/query/context.rb +4 -0
  17. data/lib/graphql/query/null_context.rb +4 -0
  18. data/lib/graphql/query.rb +26 -3
  19. data/lib/graphql/schema/always_visible.rb +1 -0
  20. data/lib/graphql/schema/enum.rb +4 -4
  21. data/lib/graphql/schema/field.rb +7 -3
  22. data/lib/graphql/schema/has_single_input_argument.rb +2 -1
  23. data/lib/graphql/schema/input_object.rb +8 -7
  24. data/lib/graphql/schema/introspection_system.rb +2 -14
  25. data/lib/graphql/schema/member/has_arguments.rb +7 -6
  26. data/lib/graphql/schema/member/has_fields.rb +6 -4
  27. data/lib/graphql/schema/resolver.rb +4 -5
  28. data/lib/graphql/schema/subset.rb +397 -0
  29. data/lib/graphql/schema/type_expression.rb +2 -2
  30. data/lib/graphql/schema/validator/all_validator.rb +60 -0
  31. data/lib/graphql/schema/validator.rb +2 -0
  32. data/lib/graphql/schema/warden.rb +88 -1
  33. data/lib/graphql/schema.rb +44 -15
  34. data/lib/graphql/static_validation/base_visitor.rb +6 -5
  35. data/lib/graphql/static_validation/literal_validator.rb +4 -4
  36. data/lib/graphql/static_validation/rules/argument_literals_are_compatible.rb +1 -1
  37. data/lib/graphql/static_validation/rules/arguments_are_defined.rb +1 -1
  38. data/lib/graphql/static_validation/rules/directives_are_defined.rb +1 -2
  39. data/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb +1 -1
  40. data/lib/graphql/static_validation/rules/fields_will_merge.rb +7 -7
  41. data/lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb +3 -3
  42. data/lib/graphql/static_validation/rules/fragment_types_exist.rb +1 -1
  43. data/lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb +1 -1
  44. data/lib/graphql/static_validation/rules/mutation_root_exists.rb +1 -1
  45. data/lib/graphql/static_validation/rules/query_root_exists.rb +1 -1
  46. data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +3 -3
  47. data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb +3 -3
  48. data/lib/graphql/static_validation/rules/subscription_root_exists.rb +1 -1
  49. data/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb +1 -1
  50. data/lib/graphql/static_validation/rules/variables_are_input_types.rb +1 -1
  51. data/lib/graphql/static_validation/validation_context.rb +2 -2
  52. data/lib/graphql/subscriptions/broadcast_analyzer.rb +10 -4
  53. data/lib/graphql/subscriptions/event.rb +1 -1
  54. data/lib/graphql/subscriptions.rb +2 -2
  55. data/lib/graphql/testing/helpers.rb +2 -2
  56. data/lib/graphql/types/relay/connection_behaviors.rb +10 -0
  57. data/lib/graphql/types/relay/edge_behaviors.rb +10 -0
  58. data/lib/graphql/types/relay/page_info_behaviors.rb +4 -0
  59. data/lib/graphql/version.rb +1 -1
  60. metadata +4 -4
  61. data/lib/graphql/language/token.rb +0 -34
  62. data/lib/graphql/schema/invalid_type_error.rb +0 -7
@@ -18,6 +18,7 @@ module GraphQL
18
18
  self.node_type = nil
19
19
  self.edge_class = nil
20
20
  }
21
+ child_class.default_broadcastable(nil)
21
22
  add_page_info_field(child_class)
22
23
  end
23
24
 
@@ -31,12 +32,21 @@ module GraphQL
31
32
  child_class.edge_type = nil
32
33
  child_class.node_type = nil
33
34
  child_class.edge_class = nil
35
+ child_class.default_broadcastable(default_broadcastable?)
34
36
  end
35
37
 
36
38
  def default_relay?
37
39
  true
38
40
  end
39
41
 
42
+ def default_broadcastable?
43
+ @default_broadcastable
44
+ end
45
+
46
+ def default_broadcastable(new_value)
47
+ @default_broadcastable = new_value
48
+ end
49
+
40
50
  # @return [Class]
41
51
  attr_reader :node_type
42
52
 
@@ -10,6 +10,7 @@ module GraphQL
10
10
  child_class.extend(ClassMethods)
11
11
  child_class.class_eval { self.node_type = nil }
12
12
  child_class.node_nullable(true)
13
+ child_class.default_broadcastable(nil)
13
14
  end
14
15
 
15
16
  def node
@@ -24,12 +25,21 @@ module GraphQL
24
25
  super
25
26
  child_class.node_type = nil
26
27
  child_class.node_nullable = nil
28
+ child_class.default_broadcastable(default_broadcastable?)
27
29
  end
28
30
 
29
31
  def default_relay?
30
32
  true
31
33
  end
32
34
 
35
+ def default_broadcastable?
36
+ @default_broadcastable
37
+ end
38
+
39
+ def default_broadcastable(new_value)
40
+ @default_broadcastable = new_value
41
+ end
42
+
33
43
  # Get or set the Object type that this edge wraps.
34
44
  #
35
45
  # @param node_type [Class] A `Schema::Object` subclass
@@ -24,6 +24,10 @@ module GraphQL
24
24
  def default_relay?
25
25
  true
26
26
  end
27
+
28
+ def default_broadcastable?
29
+ true
30
+ end
27
31
  end
28
32
  end
29
33
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "2.3.6"
3
+ VERSION = "2.3.8"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.6
4
+ version: 2.3.8
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-06-25 00:00:00.000000000 Z
11
+ date: 2024-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -376,7 +376,6 @@ files:
376
376
  - lib/graphql/language/printer.rb
377
377
  - lib/graphql/language/sanitized_printer.rb
378
378
  - lib/graphql/language/static_visitor.rb
379
- - lib/graphql/language/token.rb
380
379
  - lib/graphql/language/visitor.rb
381
380
  - lib/graphql/load_application_object_failed_error.rb
382
381
  - lib/graphql/name_validator.rb
@@ -439,7 +438,6 @@ files:
439
438
  - lib/graphql/schema/input_object.rb
440
439
  - lib/graphql/schema/interface.rb
441
440
  - lib/graphql/schema/introspection_system.rb
442
- - lib/graphql/schema/invalid_type_error.rb
443
441
  - lib/graphql/schema/late_bound_type.rb
444
442
  - lib/graphql/schema/list.rb
445
443
  - lib/graphql/schema/loader.rb
@@ -470,12 +468,14 @@ files:
470
468
  - lib/graphql/schema/resolver/has_payload_type.rb
471
469
  - lib/graphql/schema/scalar.rb
472
470
  - lib/graphql/schema/subscription.rb
471
+ - lib/graphql/schema/subset.rb
473
472
  - lib/graphql/schema/timeout.rb
474
473
  - lib/graphql/schema/type_expression.rb
475
474
  - lib/graphql/schema/type_membership.rb
476
475
  - lib/graphql/schema/union.rb
477
476
  - lib/graphql/schema/unique_within_type.rb
478
477
  - lib/graphql/schema/validator.rb
478
+ - lib/graphql/schema/validator/all_validator.rb
479
479
  - lib/graphql/schema/validator/allow_blank_validator.rb
480
480
  - lib/graphql/schema/validator/allow_null_validator.rb
481
481
  - lib/graphql/schema/validator/exclusion_validator.rb
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
- module GraphQL
3
- module Language
4
- # Emitted by the lexer and passed to the parser.
5
- # Contains type, value and position data.
6
- class Token
7
- # @return [Symbol] The kind of token this is
8
- attr_reader :name
9
- # @return [String] The text of this token
10
- attr_reader :value
11
- attr_reader :prev_token, :line, :col
12
-
13
- def initialize(name, value, line, col, prev_token)
14
- @name = name
15
- @value = -value
16
- @line = line
17
- @col = col
18
- @prev_token = prev_token
19
- end
20
-
21
- alias to_s value
22
- def to_i; @value.to_i; end
23
- def to_f; @value.to_f; end
24
-
25
- def line_and_column
26
- [@line, @col]
27
- end
28
-
29
- def inspect
30
- "(#{@name} #{@value.inspect} [#{@line}:#{@col}])"
31
- end
32
- end
33
- end
34
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
- module GraphQL
3
- class Schema
4
- class InvalidTypeError < GraphQL::Error
5
- end
6
- end
7
- end