graphql 1.10.14 → 1.11.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/graphql/core.rb +8 -0
- data/lib/generators/graphql/templates/base_argument.erb +2 -0
- data/lib/generators/graphql/templates/base_enum.erb +2 -0
- data/lib/generators/graphql/templates/base_field.erb +2 -0
- data/lib/generators/graphql/templates/base_input_object.erb +2 -0
- data/lib/generators/graphql/templates/base_interface.erb +2 -0
- data/lib/generators/graphql/templates/base_mutation.erb +2 -0
- data/lib/generators/graphql/templates/base_object.erb +2 -0
- data/lib/generators/graphql/templates/base_scalar.erb +2 -0
- data/lib/generators/graphql/templates/base_union.erb +2 -0
- data/lib/generators/graphql/templates/enum.erb +2 -0
- data/lib/generators/graphql/templates/graphql_controller.erb +13 -9
- data/lib/generators/graphql/templates/interface.erb +2 -0
- data/lib/generators/graphql/templates/loader.erb +2 -0
- data/lib/generators/graphql/templates/mutation.erb +2 -0
- data/lib/generators/graphql/templates/mutation_type.erb +2 -0
- data/lib/generators/graphql/templates/object.erb +2 -0
- data/lib/generators/graphql/templates/query_type.erb +2 -0
- data/lib/generators/graphql/templates/scalar.erb +2 -0
- data/lib/generators/graphql/templates/schema.erb +2 -0
- data/lib/generators/graphql/templates/union.erb +2 -0
- data/lib/graphql.rb +3 -3
- data/lib/graphql/execution/interpreter.rb +1 -1
- data/lib/graphql/execution/interpreter/runtime.rb +26 -26
- data/lib/graphql/execution/multiplex.rb +1 -2
- data/lib/graphql/introspection/schema_type.rb +3 -3
- data/lib/graphql/invalid_null_error.rb +18 -0
- data/lib/graphql/language/nodes.rb +1 -0
- data/lib/graphql/language/visitor.rb +2 -2
- data/lib/graphql/pagination/connection.rb +18 -13
- data/lib/graphql/pagination/connections.rb +17 -4
- data/lib/graphql/query.rb +1 -2
- data/lib/graphql/query/context.rb +20 -1
- data/lib/graphql/query/fingerprint.rb +2 -0
- data/lib/graphql/query/validation_pipeline.rb +3 -0
- data/lib/graphql/schema.rb +26 -16
- data/lib/graphql/schema/build_from_definition.rb +7 -12
- data/lib/graphql/schema/build_from_definition/resolve_map.rb +3 -1
- data/lib/graphql/schema/enum_value.rb +1 -0
- data/lib/graphql/schema/field.rb +63 -77
- data/lib/graphql/schema/field/connection_extension.rb +42 -32
- data/lib/graphql/schema/loader.rb +19 -1
- data/lib/graphql/schema/member/has_fields.rb +15 -5
- data/lib/graphql/schema/mutation.rb +4 -0
- data/lib/graphql/schema/object.rb +1 -1
- data/lib/graphql/schema/resolver.rb +20 -0
- data/lib/graphql/schema/resolver/has_payload_type.rb +2 -1
- data/lib/graphql/schema/subscription.rb +3 -13
- data/lib/graphql/schema/union.rb +29 -0
- data/lib/graphql/schema/warden.rb +2 -4
- data/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb +4 -2
- data/lib/graphql/subscriptions.rb +69 -24
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +66 -11
- data/lib/graphql/subscriptions/broadcast_analyzer.rb +84 -0
- data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +21 -0
- data/lib/graphql/subscriptions/event.rb +16 -1
- data/lib/graphql/subscriptions/serialize.rb +22 -4
- data/lib/graphql/subscriptions/subscription_root.rb +3 -1
- data/lib/graphql/tracing.rb +1 -27
- data/lib/graphql/tracing/appoptics_tracing.rb +10 -2
- data/lib/graphql/tracing/platform_tracing.rb +25 -15
- data/lib/graphql/tracing/statsd_tracing.rb +42 -0
- data/lib/graphql/types/iso_8601_date_time.rb +2 -1
- data/lib/graphql/types/relay/base_connection.rb +6 -5
- data/lib/graphql/version.rb +1 -1
- metadata +5 -2
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module GraphQL
|
4
|
+
module Tracing
|
5
|
+
class StatsdTracing < PlatformTracing
|
6
|
+
self.platform_keys = {
|
7
|
+
'lex' => "graphql.lex",
|
8
|
+
'parse' => "graphql.parse",
|
9
|
+
'validate' => "graphql.validate",
|
10
|
+
'analyze_query' => "graphql.analyze_query",
|
11
|
+
'analyze_multiplex' => "graphql.analyze_multiplex",
|
12
|
+
'execute_multiplex' => "graphql.execute_multiplex",
|
13
|
+
'execute_query' => "graphql.execute_query",
|
14
|
+
'execute_query_lazy' => "graphql.execute_query_lazy",
|
15
|
+
}
|
16
|
+
|
17
|
+
# @param statsd [Object] A statsd client
|
18
|
+
def initialize(statsd:, **rest)
|
19
|
+
@statsd = statsd
|
20
|
+
super(**rest)
|
21
|
+
end
|
22
|
+
|
23
|
+
def platform_trace(platform_key, key, data)
|
24
|
+
@statsd.time(platform_key) do
|
25
|
+
yield
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def platform_field_key(type, field)
|
30
|
+
"graphql.#{type.graphql_name}.#{field.graphql_name}"
|
31
|
+
end
|
32
|
+
|
33
|
+
def platform_authorized_key(type)
|
34
|
+
"graphql.authorized.#{type.graphql_name}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def platform_resolve_type_key(type)
|
38
|
+
"graphql.resolve_type.#{type.graphql_name}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -48,7 +48,7 @@ module GraphQL
|
|
48
48
|
# It's called when you subclass this base connection, trying to use the
|
49
49
|
# class name to set defaults. You can call it again in the class definition
|
50
50
|
# to override the default (or provide a value, if the default lookup failed).
|
51
|
-
def edge_type(edge_type_class, edge_class: GraphQL::Relay::Edge, node_type: edge_type_class.node_type, nodes_field: true)
|
51
|
+
def edge_type(edge_type_class, edge_class: GraphQL::Relay::Edge, node_type: edge_type_class.node_type, nodes_field: true, node_nullable: true)
|
52
52
|
# Set this connection's graphql name
|
53
53
|
node_type_name = node_type.graphql_name
|
54
54
|
|
@@ -61,7 +61,7 @@ module GraphQL
|
|
61
61
|
description: "A list of edges.",
|
62
62
|
edge_class: edge_class
|
63
63
|
|
64
|
-
define_nodes_field if nodes_field
|
64
|
+
define_nodes_field(node_nullable) if nodes_field
|
65
65
|
|
66
66
|
description("The connection type for #{node_type_name}.")
|
67
67
|
end
|
@@ -90,9 +90,10 @@ module GraphQL
|
|
90
90
|
|
91
91
|
private
|
92
92
|
|
93
|
-
def define_nodes_field
|
94
|
-
|
95
|
-
|
93
|
+
def define_nodes_field(nullable = true)
|
94
|
+
type = nullable ? [@node_type, null: true] : [@node_type]
|
95
|
+
field :nodes, type,
|
96
|
+
null: nullable,
|
96
97
|
description: "A list of nodes."
|
97
98
|
end
|
98
99
|
end
|
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: 1.
|
4
|
+
version: 1.11.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Mosolgo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: benchmark-ips
|
@@ -681,6 +681,8 @@ files:
|
|
681
681
|
- lib/graphql/string_type.rb
|
682
682
|
- lib/graphql/subscriptions.rb
|
683
683
|
- lib/graphql/subscriptions/action_cable_subscriptions.rb
|
684
|
+
- lib/graphql/subscriptions/broadcast_analyzer.rb
|
685
|
+
- lib/graphql/subscriptions/default_subscription_resolve_extension.rb
|
684
686
|
- lib/graphql/subscriptions/event.rb
|
685
687
|
- lib/graphql/subscriptions/instrumentation.rb
|
686
688
|
- lib/graphql/subscriptions/serialize.rb
|
@@ -696,6 +698,7 @@ files:
|
|
696
698
|
- lib/graphql/tracing/prometheus_tracing/graphql_collector.rb
|
697
699
|
- lib/graphql/tracing/scout_tracing.rb
|
698
700
|
- lib/graphql/tracing/skylight_tracing.rb
|
701
|
+
- lib/graphql/tracing/statsd_tracing.rb
|
699
702
|
- lib/graphql/type_kinds.rb
|
700
703
|
- lib/graphql/types.rb
|
701
704
|
- lib/graphql/types/big_int.rb
|