graphql 2.3.6 → 2.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphql/analysis/field_usage.rb +1 -1
- data/lib/graphql/analysis/query_complexity.rb +3 -3
- data/lib/graphql/analysis/visitor.rb +7 -6
- data/lib/graphql/execution/interpreter/runtime.rb +6 -6
- data/lib/graphql/execution/lookahead.rb +10 -10
- data/lib/graphql/introspection/directive_type.rb +1 -1
- data/lib/graphql/introspection/entry_points.rb +2 -2
- data/lib/graphql/introspection/field_type.rb +1 -1
- data/lib/graphql/introspection/schema_type.rb +13 -3
- data/lib/graphql/introspection/type_type.rb +5 -5
- data/lib/graphql/language/document_from_schema_definition.rb +19 -26
- data/lib/graphql/language/lexer.rb +0 -3
- data/lib/graphql/language/sanitized_printer.rb +1 -1
- data/lib/graphql/language.rb +0 -1
- data/lib/graphql/query/context.rb +4 -0
- data/lib/graphql/query/null_context.rb +4 -0
- data/lib/graphql/query.rb +26 -3
- data/lib/graphql/schema/always_visible.rb +1 -0
- data/lib/graphql/schema/enum.rb +4 -4
- data/lib/graphql/schema/field.rb +7 -3
- data/lib/graphql/schema/has_single_input_argument.rb +2 -1
- data/lib/graphql/schema/input_object.rb +8 -7
- data/lib/graphql/schema/introspection_system.rb +2 -14
- data/lib/graphql/schema/member/has_arguments.rb +7 -6
- data/lib/graphql/schema/member/has_fields.rb +6 -4
- data/lib/graphql/schema/resolver.rb +4 -5
- data/lib/graphql/schema/subset.rb +397 -0
- data/lib/graphql/schema/type_expression.rb +2 -2
- data/lib/graphql/schema/validator/all_validator.rb +60 -0
- data/lib/graphql/schema/validator.rb +2 -0
- data/lib/graphql/schema/warden.rb +88 -1
- data/lib/graphql/schema.rb +44 -15
- data/lib/graphql/static_validation/base_visitor.rb +6 -5
- data/lib/graphql/static_validation/literal_validator.rb +4 -4
- data/lib/graphql/static_validation/rules/argument_literals_are_compatible.rb +1 -1
- data/lib/graphql/static_validation/rules/arguments_are_defined.rb +1 -1
- data/lib/graphql/static_validation/rules/directives_are_defined.rb +1 -2
- data/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb +1 -1
- data/lib/graphql/static_validation/rules/fields_will_merge.rb +7 -7
- data/lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb +3 -3
- data/lib/graphql/static_validation/rules/fragment_types_exist.rb +1 -1
- data/lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb +1 -1
- data/lib/graphql/static_validation/rules/mutation_root_exists.rb +1 -1
- data/lib/graphql/static_validation/rules/query_root_exists.rb +1 -1
- data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +3 -3
- data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb +3 -3
- data/lib/graphql/static_validation/rules/subscription_root_exists.rb +1 -1
- data/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb +1 -1
- data/lib/graphql/static_validation/rules/variables_are_input_types.rb +1 -1
- data/lib/graphql/static_validation/validation_context.rb +2 -2
- data/lib/graphql/subscriptions/broadcast_analyzer.rb +10 -4
- data/lib/graphql/subscriptions/event.rb +1 -1
- data/lib/graphql/subscriptions.rb +2 -2
- data/lib/graphql/testing/helpers.rb +2 -2
- data/lib/graphql/types/relay/connection_behaviors.rb +10 -0
- data/lib/graphql/types/relay/edge_behaviors.rb +10 -0
- data/lib/graphql/types/relay/page_info_behaviors.rb +4 -0
- data/lib/graphql/version.rb +1 -1
- metadata +4 -4
- data/lib/graphql/language/token.rb +0 -34
- 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
|
data/lib/graphql/version.rb
CHANGED
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.
|
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-
|
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
|