graphql 1.7.14 → 1.8.0.pre1
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.
- checksums.yaml +5 -5
- data/lib/generators/graphql/function_generator.rb +1 -1
- data/lib/generators/graphql/loader_generator.rb +1 -1
- data/lib/generators/graphql/mutation_generator.rb +1 -6
- data/lib/generators/graphql/templates/function.erb +2 -2
- data/lib/generators/graphql/templates/loader.erb +2 -2
- data/lib/graphql.rb +2 -0
- data/lib/graphql/argument.rb +0 -1
- data/lib/graphql/backwards_compatibility.rb +2 -3
- data/lib/graphql/base_type.rb +18 -16
- data/lib/graphql/compatibility/query_parser_specification.rb +0 -117
- data/lib/graphql/compatibility/query_parser_specification/parse_error_specification.rb +0 -14
- data/lib/graphql/define/assign_object_field.rb +5 -12
- data/lib/graphql/deprecated_dsl.rb +28 -0
- data/lib/graphql/directive.rb +0 -1
- data/lib/graphql/enum_type.rb +1 -3
- data/lib/graphql/execution.rb +0 -1
- data/lib/graphql/execution/multiplex.rb +29 -12
- data/lib/graphql/field.rb +5 -20
- data/lib/graphql/function.rb +12 -0
- data/lib/graphql/input_object_type.rb +1 -3
- data/lib/graphql/internal_representation/node.rb +14 -26
- data/lib/graphql/internal_representation/visit.rb +6 -3
- data/lib/graphql/introspection/arguments_field.rb +0 -1
- data/lib/graphql/introspection/enum_values_field.rb +0 -1
- data/lib/graphql/introspection/fields_field.rb +0 -1
- data/lib/graphql/introspection/input_fields_field.rb +0 -1
- data/lib/graphql/introspection/interfaces_field.rb +0 -1
- data/lib/graphql/introspection/of_type_field.rb +0 -1
- data/lib/graphql/introspection/possible_types_field.rb +0 -1
- data/lib/graphql/introspection/schema_field.rb +0 -1
- data/lib/graphql/introspection/type_by_name_field.rb +0 -1
- data/lib/graphql/introspection/typename_field.rb +0 -1
- data/lib/graphql/language.rb +0 -3
- data/lib/graphql/language/generation.rb +182 -3
- data/lib/graphql/language/lexer.rb +69 -144
- data/lib/graphql/language/lexer.rl +4 -15
- data/lib/graphql/language/nodes.rb +76 -136
- data/lib/graphql/language/parser.rb +621 -668
- data/lib/graphql/language/parser.y +11 -17
- data/lib/graphql/language/token.rb +3 -10
- data/lib/graphql/object_type.rb +6 -1
- data/lib/graphql/query.rb +13 -8
- data/lib/graphql/query/arguments.rb +33 -48
- data/lib/graphql/query/context.rb +1 -0
- data/lib/graphql/query/literal_input.rb +1 -4
- data/lib/graphql/relay/connection_resolve.rb +3 -0
- data/lib/graphql/relay/global_id_resolve.rb +5 -1
- data/lib/graphql/relay/relation_connection.rb +19 -14
- data/lib/graphql/schema.rb +219 -12
- data/lib/graphql/schema/argument.rb +33 -0
- data/lib/graphql/schema/build_from_definition.rb +18 -64
- data/lib/graphql/schema/enum.rb +76 -0
- data/lib/graphql/schema/field.rb +127 -0
- data/lib/graphql/schema/field/dynamic_resolve.rb +63 -0
- data/lib/graphql/schema/field/unwrapped_resolve.rb +20 -0
- data/lib/graphql/schema/input_object.rb +61 -0
- data/lib/graphql/schema/interface.rb +32 -0
- data/lib/graphql/schema/loader.rb +2 -2
- data/lib/graphql/schema/member.rb +97 -0
- data/lib/graphql/schema/member/build_type.rb +106 -0
- data/lib/graphql/schema/member/has_fields.rb +56 -0
- data/lib/graphql/schema/member/instrumentation.rb +113 -0
- data/lib/graphql/schema/member/list_type_proxy.rb +21 -0
- data/lib/graphql/schema/member/non_null_type_proxy.rb +21 -0
- data/lib/graphql/schema/object.rb +65 -0
- data/lib/graphql/schema/printer.rb +266 -33
- data/lib/graphql/schema/scalar.rb +25 -0
- data/lib/graphql/schema/traversal.rb +26 -17
- data/lib/graphql/schema/union.rb +48 -0
- data/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb +1 -5
- data/lib/graphql/static_validation/rules/fields_will_merge.rb +8 -15
- data/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb +1 -11
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +5 -7
- data/lib/graphql/tracing.rb +0 -1
- data/lib/graphql/tracing/platform_tracing.rb +7 -20
- data/lib/graphql/tracing/scout_tracing.rb +2 -2
- data/lib/graphql/unresolved_type_error.rb +2 -3
- data/lib/graphql/version.rb +1 -1
- data/readme.md +1 -1
- data/spec/dummy/app/channels/graphql_channel.rb +1 -22
- data/spec/dummy/log/development.log +0 -239
- data/spec/dummy/log/test.log +0 -204
- data/spec/dummy/test/system/action_cable_subscription_test.rb +0 -4
- data/spec/dummy/tmp/screenshots/failures_test_it_handles_subscriptions.png +0 -0
- data/spec/generators/graphql/function_generator_spec.rb +0 -26
- data/spec/generators/graphql/loader_generator_spec.rb +0 -24
- data/spec/graphql/analysis/max_query_complexity_spec.rb +3 -3
- data/spec/graphql/analysis/max_query_depth_spec.rb +3 -3
- data/spec/graphql/backtrace_spec.rb +0 -10
- data/spec/graphql/base_type_spec.rb +5 -19
- data/spec/graphql/boolean_type_spec.rb +3 -3
- data/spec/graphql/directive_spec.rb +1 -3
- data/spec/graphql/enum_type_spec.rb +5 -18
- data/spec/graphql/execution/execute_spec.rb +1 -1
- data/spec/graphql/execution/multiplex_spec.rb +2 -2
- data/spec/graphql/float_type_spec.rb +2 -2
- data/spec/graphql/id_type_spec.rb +1 -1
- data/spec/graphql/input_object_type_spec.rb +2 -15
- data/spec/graphql/int_type_spec.rb +2 -2
- data/spec/graphql/internal_representation/rewrite_spec.rb +2 -2
- data/spec/graphql/introspection/schema_type_spec.rb +0 -1
- data/spec/graphql/language/generation_spec.rb +186 -21
- data/spec/graphql/language/lexer_spec.rb +1 -21
- data/spec/graphql/language/nodes_spec.rb +12 -21
- data/spec/graphql/language/parser_spec.rb +1 -1
- data/spec/graphql/query/arguments_spec.rb +15 -37
- data/spec/graphql/query/serial_execution/value_resolution_spec.rb +2 -2
- data/spec/graphql/query/variables_spec.rb +1 -1
- data/spec/graphql/query_spec.rb +5 -31
- data/spec/graphql/rake_task_spec.rb +1 -3
- data/spec/graphql/relay/base_connection_spec.rb +1 -1
- data/spec/graphql/relay/connection_instrumentation_spec.rb +2 -2
- data/spec/graphql/relay/connection_resolve_spec.rb +1 -1
- data/spec/graphql/relay/connection_type_spec.rb +1 -1
- data/spec/graphql/relay/mutation_spec.rb +3 -3
- data/spec/graphql/relay/relation_connection_spec.rb +1 -65
- data/spec/graphql/schema/build_from_definition_spec.rb +4 -86
- data/spec/graphql/schema/enum_spec.rb +60 -0
- data/spec/graphql/schema/field_spec.rb +14 -0
- data/spec/graphql/schema/input_object_spec.rb +43 -0
- data/spec/graphql/schema/interface_spec.rb +98 -0
- data/spec/graphql/schema/object_spec.rb +119 -0
- data/spec/graphql/schema/printer_spec.rb +15 -92
- data/spec/graphql/schema/scalar_spec.rb +40 -0
- data/spec/graphql/schema/union_spec.rb +35 -0
- data/spec/graphql/schema/validation_spec.rb +1 -1
- data/spec/graphql/schema/warden_spec.rb +11 -11
- data/spec/graphql/schema_spec.rb +25 -23
- data/spec/graphql/static_validation/rules/fields_have_appropriate_selections_spec.rb +2 -10
- data/spec/graphql/static_validation/rules/fields_will_merge_spec.rb +2 -2
- data/spec/graphql/string_type_spec.rb +3 -3
- data/spec/graphql/subscriptions_spec.rb +1 -1
- data/spec/graphql/tracing/platform_tracing_spec.rb +1 -60
- data/spec/support/dummy/schema.rb +25 -39
- data/spec/support/jazz.rb +334 -0
- data/spec/support/lazy_helpers.rb +21 -23
- data/spec/support/star_wars/data.rb +7 -6
- data/spec/support/star_wars/schema.rb +109 -142
- metadata +39 -33
- data/lib/graphql/execution/instrumentation.rb +0 -82
- data/lib/graphql/language/block_string.rb +0 -47
- data/lib/graphql/language/document_from_schema_definition.rb +0 -277
- data/lib/graphql/language/printer.rb +0 -351
- data/lib/graphql/tracing/data_dog_tracing.rb +0 -49
- data/spec/graphql/execution/instrumentation_spec.rb +0 -165
- data/spec/graphql/language/block_string_spec.rb +0 -70
- data/spec/graphql/language/document_from_schema_definition_spec.rb +0 -770
- data/spec/graphql/language/printer_spec.rb +0 -203
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module GraphQL
|
3
|
+
class Schema
|
4
|
+
class Scalar < GraphQL::Schema::Member
|
5
|
+
class << self
|
6
|
+
def coerce_input(val, ctx)
|
7
|
+
raise NotImplementedError, "#{self.name}.coerce_input(val, ctx) must prepare GraphQL input (#{val.inspect}) for Ruby processing"
|
8
|
+
end
|
9
|
+
|
10
|
+
def coerce_result(val, ctx)
|
11
|
+
raise NotImplementedError, "#{self.name}.coerce_result(val, ctx) must prepare Ruby value (#{val.inspect}) for GraphQL response"
|
12
|
+
end
|
13
|
+
|
14
|
+
def to_graphql
|
15
|
+
type_defn = GraphQL::ScalarType.new
|
16
|
+
type_defn.name = graphql_name
|
17
|
+
type_defn.description = description
|
18
|
+
type_defn.coerce_result = method(:coerce_result)
|
19
|
+
type_defn.coerce_input = method(:coerce_input)
|
20
|
+
type_defn
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -29,15 +29,15 @@ module GraphQL
|
|
29
29
|
@instrumented_field_map = Hash.new { |h, k| h[k] = {} }
|
30
30
|
@type_reference_map = Hash.new { |h, k| h[k] = [] }
|
31
31
|
@union_memberships = Hash.new { |h, k| h[k] = [] }
|
32
|
-
visit(schema, nil)
|
32
|
+
visit(schema, schema, nil)
|
33
33
|
end
|
34
34
|
|
35
35
|
private
|
36
36
|
|
37
|
-
def visit(member, context_description)
|
37
|
+
def visit(schema, member, context_description)
|
38
38
|
case member
|
39
39
|
when GraphQL::Schema
|
40
|
-
member.directives.each { |name, directive| visit(directive, "Directive #{name}") }
|
40
|
+
member.directives.each { |name, directive| visit(schema, directive, "Directive #{name}") }
|
41
41
|
# Find the starting points, then visit them
|
42
42
|
visit_roots = [member.query, member.mutation, member.subscription]
|
43
43
|
if @introspection
|
@@ -45,16 +45,16 @@ module GraphQL
|
|
45
45
|
if member.query
|
46
46
|
# Visit this so that arguments class is preconstructed
|
47
47
|
# Skip validation since it begins with __
|
48
|
-
visit_field_on_type(member.query, GraphQL::Introspection::TypeByNameField, dynamic_field: true)
|
48
|
+
visit_field_on_type(schema, member.query, GraphQL::Introspection::TypeByNameField, dynamic_field: true)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
visit_roots.concat(member.orphan_types)
|
52
52
|
visit_roots.compact!
|
53
|
-
visit_roots.each { |t| visit(t, t.name) }
|
53
|
+
visit_roots.each { |t| visit(schema, t, t.name) }
|
54
54
|
when GraphQL::Directive
|
55
55
|
member.arguments.each do |name, argument|
|
56
56
|
@type_reference_map[argument.type.unwrap.to_s] << argument
|
57
|
-
visit(argument.type, "Directive argument #{member.name}.#{name}")
|
57
|
+
visit(schema, argument.type, "Directive argument #{member.name}.#{name}")
|
58
58
|
end
|
59
59
|
# Construct arguments class here, which is later used to generate GraphQL::Query::Arguments
|
60
60
|
# to be passed to a resolver proc
|
@@ -68,42 +68,51 @@ module GraphQL
|
|
68
68
|
@type_map[type_defn.name] = type_defn
|
69
69
|
case type_defn
|
70
70
|
when GraphQL::ObjectType
|
71
|
-
type_defn.interfaces.each { |i| visit(i, "Interface on #{type_defn.name}") }
|
72
|
-
visit_fields(type_defn)
|
71
|
+
type_defn.interfaces.each { |i| visit(schema, i, "Interface on #{type_defn.name}") }
|
72
|
+
visit_fields(schema, type_defn)
|
73
73
|
when GraphQL::InterfaceType
|
74
|
-
visit_fields(type_defn)
|
74
|
+
visit_fields(schema, type_defn)
|
75
75
|
when GraphQL::UnionType
|
76
76
|
type_defn.possible_types.each do |t|
|
77
77
|
@union_memberships[t.name] << type_defn
|
78
|
-
visit(t, "Possible type for #{type_defn.name}")
|
78
|
+
visit(schema, t, "Possible type for #{type_defn.name}")
|
79
79
|
end
|
80
80
|
when GraphQL::InputObjectType
|
81
81
|
type_defn.arguments.each do |name, arg|
|
82
82
|
@type_reference_map[arg.type.unwrap.to_s] << arg
|
83
|
-
visit(arg.type, "Input field #{type_defn.name}.#{name}")
|
83
|
+
visit(schema, arg.type, "Input field #{type_defn.name}.#{name}")
|
84
84
|
end
|
85
85
|
|
86
86
|
# Construct arguments class here, which is later used to generate GraphQL::Query::Arguments
|
87
87
|
# to be passed to a resolver proc
|
88
|
-
|
88
|
+
if type_defn.arguments_class.nil?
|
89
|
+
GraphQL::Query::Arguments.construct_arguments_class(type_defn)
|
90
|
+
end
|
89
91
|
end
|
90
92
|
elsif !prev_type.equal?(type_defn)
|
91
93
|
# If the previous entry in the map isn't the same object we just found, raise.
|
92
94
|
raise("Duplicate type definition found for name '#{type_defn.name}'")
|
93
95
|
end
|
96
|
+
when Class
|
97
|
+
if member.respond_to?(:graphql_definition)
|
98
|
+
graphql_member = member.graphql_definition
|
99
|
+
visit(schema, graphql_member, context_description)
|
100
|
+
else
|
101
|
+
raise GraphQL::Schema::InvalidTypeError.new("Unexpected traversal member: #{member} (#{member.class.name})")
|
102
|
+
end
|
94
103
|
else
|
95
104
|
message = "Unexpected schema traversal member: #{member} (#{member.class.name})"
|
96
105
|
raise GraphQL::Schema::InvalidTypeError.new(message)
|
97
106
|
end
|
98
107
|
end
|
99
108
|
|
100
|
-
def visit_fields(type_defn)
|
109
|
+
def visit_fields(schema, type_defn)
|
101
110
|
type_defn.all_fields.each do |field_defn|
|
102
|
-
visit_field_on_type(type_defn, field_defn)
|
111
|
+
visit_field_on_type(schema, type_defn, field_defn)
|
103
112
|
end
|
104
113
|
end
|
105
114
|
|
106
|
-
def visit_field_on_type(type_defn, field_defn, dynamic_field: false)
|
115
|
+
def visit_field_on_type(schema, type_defn, field_defn, dynamic_field: false)
|
107
116
|
if dynamic_field
|
108
117
|
# Don't apply instrumentation to dynamic fields since they're shared constants
|
109
118
|
instrumented_field_defn = field_defn
|
@@ -114,11 +123,11 @@ module GraphQL
|
|
114
123
|
@instrumented_field_map[type_defn.name][instrumented_field_defn.name] = instrumented_field_defn
|
115
124
|
end
|
116
125
|
@type_reference_map[instrumented_field_defn.type.unwrap.name] << instrumented_field_defn
|
117
|
-
visit(instrumented_field_defn.type, "Field #{type_defn.name}.#{instrumented_field_defn.name}'s return type")
|
126
|
+
visit(schema, instrumented_field_defn.type, "Field #{type_defn.name}.#{instrumented_field_defn.name}'s return type")
|
118
127
|
|
119
128
|
instrumented_field_defn.arguments.each do |name, arg|
|
120
129
|
@type_reference_map[arg.type.unwrap.to_s] << arg
|
121
|
-
visit(arg.type, "Argument #{name} on #{type_defn.name}.#{instrumented_field_defn.name}")
|
130
|
+
visit(schema, arg.type, "Argument #{name} on #{type_defn.name}.#{instrumented_field_defn.name}")
|
122
131
|
end
|
123
132
|
|
124
133
|
# Construct arguments class here, which is later used to generate GraphQL::Query::Arguments
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module GraphQL
|
3
|
+
class Schema
|
4
|
+
class Union < GraphQL::Schema::Member
|
5
|
+
def initialize(obj, ctx)
|
6
|
+
@object = obj
|
7
|
+
@context = ctx
|
8
|
+
end
|
9
|
+
|
10
|
+
class << self
|
11
|
+
def possible_types(*types)
|
12
|
+
if types.any?
|
13
|
+
@own_possible_types = types
|
14
|
+
else
|
15
|
+
all_possible_types = own_possible_types
|
16
|
+
inherited_possible_types = (superclass < GraphQL::Schema::Union ? superclass.possible_types : [])
|
17
|
+
all_possible_types += inherited_possible_types
|
18
|
+
all_possible_types.uniq
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def own_possible_types
|
23
|
+
@own_possible_types ||= []
|
24
|
+
end
|
25
|
+
|
26
|
+
# The class resolves type by:
|
27
|
+
# - make an instance
|
28
|
+
# - call the instance method
|
29
|
+
def resolve_type(value, ctx)
|
30
|
+
self.new(value, ctx).resolve_type
|
31
|
+
end
|
32
|
+
|
33
|
+
def to_graphql
|
34
|
+
type_defn = GraphQL::UnionType.new
|
35
|
+
type_defn.name = graphql_name
|
36
|
+
type_defn.description = description
|
37
|
+
type_defn.possible_types = possible_types
|
38
|
+
# If an instance method is defined, use it as a
|
39
|
+
# resolve type hook, via the class method
|
40
|
+
if method_defined?(:resolve_type)
|
41
|
+
type_defn.resolve_type = method(:resolve_type)
|
42
|
+
end
|
43
|
+
type_defn
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -24,11 +24,7 @@ module GraphQL
|
|
24
24
|
msg = if resolved_type.nil?
|
25
25
|
nil
|
26
26
|
elsif resolved_type.kind.scalar? && ast_node.selections.any?
|
27
|
-
|
28
|
-
"Selections can't be made on scalars (%{node_name} returns #{resolved_type.name} but has inline fragments [#{ast_node.selections.map(&:type).map(&:name).join(", ")}])"
|
29
|
-
else
|
30
|
-
"Selections can't be made on scalars (%{node_name} returns #{resolved_type.name} but has selections [#{ast_node.selections.map(&:name).join(", ")}])"
|
31
|
-
end
|
27
|
+
"Selections can't be made on scalars (%{node_name} returns #{resolved_type.name} but has selections [#{ast_node.selections.map(&:name).join(", ")}])"
|
32
28
|
elsif resolved_type.kind.object? && ast_node.selections.none?
|
33
29
|
"Objects must have selections (%{node_name} returns #{resolved_type.name} but has no selections)"
|
34
30
|
else
|
@@ -2,9 +2,6 @@
|
|
2
2
|
module GraphQL
|
3
3
|
module StaticValidation
|
4
4
|
class FieldsWillMerge
|
5
|
-
# Special handling for fields without arguments
|
6
|
-
NO_ARGS = {}.freeze
|
7
|
-
|
8
5
|
def validate(context)
|
9
6
|
context.each_irep_node do |node|
|
10
7
|
if node.ast_nodes.size > 1
|
@@ -19,19 +16,15 @@ module GraphQL
|
|
19
16
|
|
20
17
|
# Check for incompatible / non-identical arguments on this node:
|
21
18
|
args = node.ast_nodes.map do |n|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
GraphQL::Language.serialize(arg_value)
|
30
|
-
end
|
31
|
-
memo
|
19
|
+
n.arguments.reduce({}) do |memo, a|
|
20
|
+
arg_value = a.value
|
21
|
+
memo[a.name] = case arg_value
|
22
|
+
when GraphQL::Language::Nodes::AbstractNode
|
23
|
+
arg_value.to_query_string
|
24
|
+
else
|
25
|
+
GraphQL::Language.serialize(arg_value)
|
32
26
|
end
|
33
|
-
|
34
|
-
NO_ARGS
|
27
|
+
memo
|
35
28
|
end
|
36
29
|
end
|
37
30
|
args.uniq!
|
@@ -102,17 +102,7 @@ module GraphQL
|
|
102
102
|
def follow_spreads(node, parent_variables, spreads_for_context, fragment_definitions, visited_fragments)
|
103
103
|
spreads = spreads_for_context[node] - visited_fragments
|
104
104
|
spreads.each do |spread_name|
|
105
|
-
def_node =
|
106
|
-
variables = nil
|
107
|
-
# Implement `.find` by hand to avoid Ruby's internal allocations
|
108
|
-
fragment_definitions.each do |frag_def_node, vars|
|
109
|
-
if frag_def_node.name == spread_name
|
110
|
-
def_node = frag_def_node
|
111
|
-
variables = vars
|
112
|
-
break
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
105
|
+
def_node, variables = fragment_definitions.find { |def_node, vars| def_node.name == spread_name }
|
116
106
|
next if !def_node
|
117
107
|
visited_fragments << spread_name
|
118
108
|
variables.each do |name, child_usage|
|
@@ -39,7 +39,7 @@ module GraphQL
|
|
39
39
|
# })
|
40
40
|
#
|
41
41
|
# payload = {
|
42
|
-
# result: result.subscription? ?
|
42
|
+
# result: result.subscription? ? nil : result.to_h,
|
43
43
|
# more: result.subscription?,
|
44
44
|
# }
|
45
45
|
#
|
@@ -62,21 +62,19 @@ module GraphQL
|
|
62
62
|
class ActionCableSubscriptions < GraphQL::Subscriptions
|
63
63
|
SUBSCRIPTION_PREFIX = "graphql-subscription:"
|
64
64
|
EVENT_PREFIX = "graphql-event:"
|
65
|
-
|
66
|
-
# @param serializer [<#dump(obj), #load(string)] Used for serializing messages before handing them to `.broadcast(msg)`
|
67
|
-
def initialize(serializer: Serialize, **rest)
|
65
|
+
def initialize(**rest)
|
68
66
|
# A per-process map of subscriptions to deliver.
|
69
67
|
# This is provided by Rails, so let's use it
|
70
68
|
@subscriptions = Concurrent::Map.new
|
71
|
-
@serializer = serializer
|
72
69
|
super
|
73
70
|
end
|
74
71
|
|
75
72
|
# An event was triggered; Push the data over ActionCable.
|
76
73
|
# Subscribers will re-evaluate locally.
|
74
|
+
# TODO: this method name is a smell
|
77
75
|
def execute_all(event, object)
|
78
76
|
stream = EVENT_PREFIX + event.topic
|
79
|
-
message =
|
77
|
+
message = Serialize.dump(object)
|
80
78
|
ActionCable.server.broadcast(stream, message)
|
81
79
|
end
|
82
80
|
|
@@ -99,7 +97,7 @@ module GraphQL
|
|
99
97
|
@subscriptions[subscription_id] = query
|
100
98
|
events.each do |event|
|
101
99
|
channel.stream_from(EVENT_PREFIX + event.topic, coder: ActiveSupport::JSON) do |message|
|
102
|
-
execute(subscription_id, event,
|
100
|
+
execute(subscription_id, event, Serialize.load(message))
|
103
101
|
nil
|
104
102
|
end
|
105
103
|
end
|
data/lib/graphql/tracing.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
require "graphql/tracing/active_support_notifications_tracing"
|
3
3
|
require "graphql/tracing/platform_tracing"
|
4
4
|
require "graphql/tracing/appsignal_tracing"
|
5
|
-
require "graphql/tracing/data_dog_tracing"
|
6
5
|
require "graphql/tracing/new_relic_tracing"
|
7
6
|
require "graphql/tracing/scout_tracing"
|
8
7
|
require "graphql/tracing/skylight_tracing"
|
@@ -12,10 +12,8 @@ module GraphQL
|
|
12
12
|
attr_accessor :platform_keys
|
13
13
|
end
|
14
14
|
|
15
|
-
def initialize
|
16
|
-
@options = options
|
15
|
+
def initialize
|
17
16
|
@platform_keys = self.class.platform_keys
|
18
|
-
@trace_scalars = options.fetch(:trace_scalars, false)
|
19
17
|
end
|
20
18
|
|
21
19
|
def trace(key, data)
|
@@ -43,30 +41,19 @@ module GraphQL
|
|
43
41
|
return_type = field.type.unwrap
|
44
42
|
case return_type
|
45
43
|
when GraphQL::ScalarType, GraphQL::EnumType
|
46
|
-
|
47
|
-
trace_field(type, field)
|
48
|
-
else
|
49
|
-
field
|
50
|
-
end
|
44
|
+
field
|
51
45
|
else
|
52
|
-
|
46
|
+
new_f = field.redefine
|
47
|
+
new_f.metadata[:platform_key] = platform_field_key(type, field)
|
48
|
+
new_f
|
53
49
|
end
|
54
50
|
end
|
55
51
|
|
56
|
-
def
|
57
|
-
|
58
|
-
new_f.metadata[:platform_key] = platform_field_key(type, field)
|
59
|
-
new_f
|
60
|
-
end
|
61
|
-
|
62
|
-
def self.use(schema_defn, options = {})
|
63
|
-
tracer = self.new(options)
|
52
|
+
def self.use(schema_defn)
|
53
|
+
tracer = self.new
|
64
54
|
schema_defn.instrument(:field, tracer)
|
65
55
|
schema_defn.tracer(tracer)
|
66
56
|
end
|
67
|
-
|
68
|
-
private
|
69
|
-
attr_reader :options
|
70
57
|
end
|
71
58
|
end
|
72
59
|
end
|
@@ -26,9 +26,8 @@ module GraphQL
|
|
26
26
|
@possible_types = possible_types
|
27
27
|
message = "The value from \"#{field.name}\" on \"#{parent_type}\" could not be resolved to \"#{field.type}\". " \
|
28
28
|
"(Received: `#{resolved_type.inspect}`, Expected: [#{possible_types.map(&:inspect).join(", ")}]) " \
|
29
|
-
"Make sure you have defined a `
|
30
|
-
"gets resolved to a valid type.
|
31
|
-
"interface but isn't a return type of any other field."
|
29
|
+
"Make sure you have defined a `type_from_object` proc on your schema and that value `#{value.inspect}` " \
|
30
|
+
"gets resolved to a valid type."
|
32
31
|
super(message)
|
33
32
|
end
|
34
33
|
end
|
data/lib/graphql/version.rb
CHANGED
data/readme.md
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
A Ruby implementation of [GraphQL](http://graphql.org/).
|
10
10
|
|
11
11
|
- [Website](https://rmosolgo.github.io/graphql-ruby)
|
12
|
-
- [API Documentation](http://www.rubydoc.info/
|
12
|
+
- [API Documentation](http://www.rubydoc.info/github/rmosolgo/graphql-ruby)
|
13
13
|
- [Newsletter](https://tinyletter.com/graphql-ruby)
|
14
14
|
|
15
15
|
## Installation
|
@@ -17,31 +17,10 @@ class GraphqlChannel < ActionCable::Channel::Base
|
|
17
17
|
field :value, types.Int
|
18
18
|
end
|
19
19
|
|
20
|
-
# Wacky behavior around the number 4
|
21
|
-
# so we can confirm it's used by the UI
|
22
|
-
module CustomSerializer
|
23
|
-
def self.load(value)
|
24
|
-
if value == "4x"
|
25
|
-
ExamplePayload.new(400)
|
26
|
-
else
|
27
|
-
GraphQL::Subscriptions::Serialize.load(value)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.dump(obj)
|
32
|
-
if obj.is_a?(ExamplePayload) && obj.value == 4
|
33
|
-
"4x"
|
34
|
-
else
|
35
|
-
GraphQL::Subscriptions::Serialize.dump(obj)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
20
|
GraphQLSchema = GraphQL::Schema.define do
|
41
21
|
query(QueryType)
|
42
22
|
subscription(SubscriptionType)
|
43
|
-
use GraphQL::Subscriptions::ActionCableSubscriptions
|
44
|
-
serializer: CustomSerializer
|
23
|
+
use GraphQL::Subscriptions::ActionCableSubscriptions
|
45
24
|
end
|
46
25
|
|
47
26
|
def subscribed
|
@@ -358,242 +358,3 @@ GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>5})
|
|
358
358
|
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzU\"}"
|
359
359
|
[ActionCable] Broadcasting to graphql-subscription:c2334c1a-d146-4b1c-90d9-9cb1c7b4046d: {:result=>{"data"=>{"payload"=>{"value"=>5}}}, :more=>true}
|
360
360
|
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>5}}}, "more"=>true} (via streamed from graphql-subscription:c2334c1a-d146-4b1c-90d9-9cb1c7b4046d)
|
361
|
-
Started GET "/" for 127.0.0.1 at 2017-11-16 21:27:24 -0500
|
362
|
-
Processing by PagesController#show as HTML
|
363
|
-
Rendering pages/show.html within layouts/application
|
364
|
-
Rendered pages/show.html within layouts/application (0.8ms)
|
365
|
-
Completed 200 OK in 173ms (Views: 171.5ms)
|
366
|
-
|
367
|
-
|
368
|
-
Started GET "/assets/application-aca150c4b2db51d5326af18134f6281fbce7e823a372b0337cca65ff41b4a7ea.js" for 127.0.0.1 at 2017-11-16 21:27:24 -0500
|
369
|
-
Started GET "/cable" for 127.0.0.1 at 2017-11-16 21:27:24 -0500
|
370
|
-
Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:27:24 -0500
|
371
|
-
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
|
372
|
-
GraphqlChannel is transmitting the subscription confirmation
|
373
|
-
GraphqlChannel is transmitting the subscription confirmation
|
374
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-2"}})
|
375
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
376
|
-
GraphqlChannel is streaming from graphql-subscription:34ad7c3f-9311-4982-b873-312032bbcd76
|
377
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-1"}})
|
378
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
379
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-2
|
380
|
-
GraphqlChannel is streaming from graphql-subscription:73055d69-7575-4caa-88b7-74e1a1070c0d
|
381
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-1
|
382
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>1})
|
383
|
-
Could not execute command from ({"command"=>"message", "identifier"=>"{\"channel\":\"GraphqlChannel\",\"id\":\"15fc7cd712b\"}", "data"=>"{\"id\":\"updates-1\",\"value\":1,\"action\":\"make_trigger\"}"}) [NoMethodError - undefined method `dump_value' for GraphqlChannel::CustomSerializer:Module]: /Users/rmosolgo/code/graphql-ruby/lib/graphql/subscriptions/serialize.rb:21:in `dump' | /Users/rmosolgo/code/graphql-ruby/spec/dummy/app/channels/graphql_channel.rb:36:in `dump' | /Users/rmosolgo/code/graphql-ruby/lib/graphql/subscriptions/action_cable_subscriptions.rb:78:in `execute_all' | /Users/rmosolgo/code/graphql-ruby/lib/graphql/subscriptions.rb:52:in `trigger' | /Users/rmosolgo/code/graphql-ruby/spec/dummy/app/channels/graphql_channel.rb:83:in `make_trigger'
|
384
|
-
Started GET "/" for 127.0.0.1 at 2017-11-16 21:28:22 -0500
|
385
|
-
Processing by PagesController#show as HTML
|
386
|
-
Rendering pages/show.html within layouts/application
|
387
|
-
Rendered pages/show.html within layouts/application (0.6ms)
|
388
|
-
Completed 200 OK in 166ms (Views: 164.8ms)
|
389
|
-
|
390
|
-
|
391
|
-
Started GET "/cable" for 127.0.0.1 at 2017-11-16 21:28:23 -0500
|
392
|
-
Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:28:23 -0500
|
393
|
-
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
|
394
|
-
GraphqlChannel is transmitting the subscription confirmation
|
395
|
-
GraphqlChannel is transmitting the subscription confirmation
|
396
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-2"}})
|
397
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
398
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-1"}})
|
399
|
-
GraphqlChannel is streaming from graphql-subscription:dee02509-90a6-4ac1-8c1d-c765cb445ddd
|
400
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
401
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-2
|
402
|
-
GraphqlChannel is streaming from graphql-subscription:0f50c340-d3cd-4ab7-8e6a-055d23083185
|
403
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-1
|
404
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>1})
|
405
|
-
Could not execute command from ({"command"=>"message", "identifier"=>"{\"channel\":\"GraphqlChannel\",\"id\":\"15fc7cf7d8b\"}", "data"=>"{\"id\":\"updates-1\",\"value\":1,\"action\":\"make_trigger\"}"}) [NameError - undefined local variable or method `value' for GraphqlChannel::CustomSerializer:Module]: /Users/rmosolgo/code/graphql-ruby/spec/dummy/app/channels/graphql_channel.rb:35:in `dump' | /Users/rmosolgo/code/graphql-ruby/lib/graphql/subscriptions/action_cable_subscriptions.rb:78:in `execute_all' | /Users/rmosolgo/code/graphql-ruby/lib/graphql/subscriptions.rb:52:in `trigger' | /Users/rmosolgo/code/graphql-ruby/spec/dummy/app/channels/graphql_channel.rb:82:in `make_trigger' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/channel/base.rb:262:in `public_send'
|
406
|
-
Started GET "/" for 127.0.0.1 at 2017-11-16 21:28:40 -0500
|
407
|
-
Processing by PagesController#show as HTML
|
408
|
-
Rendering pages/show.html within layouts/application
|
409
|
-
Rendered pages/show.html within layouts/application (0.6ms)
|
410
|
-
Completed 200 OK in 11ms (Views: 8.8ms)
|
411
|
-
|
412
|
-
|
413
|
-
Started GET "/cable" for 127.0.0.1 at 2017-11-16 21:28:40 -0500
|
414
|
-
Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:28:40 -0500
|
415
|
-
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
|
416
|
-
GraphqlChannel is transmitting the subscription confirmation
|
417
|
-
GraphqlChannel is transmitting the subscription confirmation
|
418
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-2"}})
|
419
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
420
|
-
GraphqlChannel is streaming from graphql-subscription:528198ff-21c1-4051-a319-1feb9060f335
|
421
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-2
|
422
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-1"}})
|
423
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
424
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-1
|
425
|
-
GraphqlChannel is streaming from graphql-subscription:dba8445d-3284-4734-90f6-fdf8f0707a50
|
426
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>1})
|
427
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzE\"}"
|
428
|
-
[ActionCable] Broadcasting to graphql-subscription:dba8445d-3284-4734-90f6-fdf8f0707a50: {:result=>{"data"=>{"payload"=>{"value"=>1}}}, :more=>true}
|
429
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>1}}}, "more"=>true} (via streamed from graphql-subscription:dba8445d-3284-4734-90f6-fdf8f0707a50)
|
430
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>2})
|
431
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzI\"}"
|
432
|
-
[ActionCable] Broadcasting to graphql-subscription:dba8445d-3284-4734-90f6-fdf8f0707a50: {:result=>{"data"=>{"payload"=>{"value"=>2}}}, :more=>true}
|
433
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>2}}}, "more"=>true} (via streamed from graphql-subscription:dba8445d-3284-4734-90f6-fdf8f0707a50)
|
434
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>3})
|
435
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzM\"}"
|
436
|
-
[ActionCable] Broadcasting to graphql-subscription:dba8445d-3284-4734-90f6-fdf8f0707a50: {:result=>{"data"=>{"payload"=>{"value"=>3}}}, :more=>true}
|
437
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>3}}}, "more"=>true} (via streamed from graphql-subscription:dba8445d-3284-4734-90f6-fdf8f0707a50)
|
438
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>4})
|
439
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "4x"
|
440
|
-
[ActionCable] Broadcasting to graphql-subscription:dba8445d-3284-4734-90f6-fdf8f0707a50: {:result=>{"data"=>{"payload"=>{"value"=>4}}}, :more=>true}
|
441
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>4}}}, "more"=>true} (via streamed from graphql-subscription:dba8445d-3284-4734-90f6-fdf8f0707a50)
|
442
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>5})
|
443
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzU\"}"
|
444
|
-
[ActionCable] Broadcasting to graphql-subscription:dba8445d-3284-4734-90f6-fdf8f0707a50: {:result=>{"data"=>{"payload"=>{"value"=>5}}}, :more=>true}
|
445
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>5}}}, "more"=>true} (via streamed from graphql-subscription:dba8445d-3284-4734-90f6-fdf8f0707a50)
|
446
|
-
Started GET "/" for 127.0.0.1 at 2017-11-16 21:29:15 -0500
|
447
|
-
Processing by PagesController#show as HTML
|
448
|
-
Rendering pages/show.html within layouts/application
|
449
|
-
Rendered pages/show.html within layouts/application (0.8ms)
|
450
|
-
Completed 200 OK in 178ms (Views: 176.8ms)
|
451
|
-
|
452
|
-
|
453
|
-
Started GET "/cable" for 127.0.0.1 at 2017-11-16 21:29:15 -0500
|
454
|
-
Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:29:15 -0500
|
455
|
-
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
|
456
|
-
GraphqlChannel is transmitting the subscription confirmation
|
457
|
-
GraphqlChannel is transmitting the subscription confirmation
|
458
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-1"}})
|
459
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
460
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-2"}})
|
461
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-1
|
462
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
463
|
-
GraphqlChannel is streaming from graphql-subscription:ac17fc47-fdf3-4951-813b-f4d04fdc7847
|
464
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-2
|
465
|
-
GraphqlChannel is streaming from graphql-subscription:8642d019-1a8c-4eb9-ada2-7a5b1ccffeee
|
466
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>1})
|
467
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzE\"}"
|
468
|
-
[ActionCable] Broadcasting to graphql-subscription:ac17fc47-fdf3-4951-813b-f4d04fdc7847: {:result=>{"data"=>{"payload"=>{"value"=>1}}}, :more=>true}
|
469
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>1}}}, "more"=>true} (via streamed from graphql-subscription:ac17fc47-fdf3-4951-813b-f4d04fdc7847)
|
470
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>2})
|
471
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzI\"}"
|
472
|
-
[ActionCable] Broadcasting to graphql-subscription:ac17fc47-fdf3-4951-813b-f4d04fdc7847: {:result=>{"data"=>{"payload"=>{"value"=>2}}}, :more=>true}
|
473
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>2}}}, "more"=>true} (via streamed from graphql-subscription:ac17fc47-fdf3-4951-813b-f4d04fdc7847)
|
474
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>3})
|
475
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzM\"}"
|
476
|
-
[ActionCable] Broadcasting to graphql-subscription:ac17fc47-fdf3-4951-813b-f4d04fdc7847: {:result=>{"data"=>{"payload"=>{"value"=>3}}}, :more=>true}
|
477
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>3}}}, "more"=>true} (via streamed from graphql-subscription:ac17fc47-fdf3-4951-813b-f4d04fdc7847)
|
478
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>4})
|
479
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "4x"
|
480
|
-
[ActionCable] Broadcasting to graphql-subscription:ac17fc47-fdf3-4951-813b-f4d04fdc7847: {:result=>{"data"=>{"payload"=>{"value"=>4}}}, :more=>true}
|
481
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>4}}}, "more"=>true} (via streamed from graphql-subscription:ac17fc47-fdf3-4951-813b-f4d04fdc7847)
|
482
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>5})
|
483
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzU\"}"
|
484
|
-
[ActionCable] Broadcasting to graphql-subscription:ac17fc47-fdf3-4951-813b-f4d04fdc7847: {:result=>{"data"=>{"payload"=>{"value"=>5}}}, :more=>true}
|
485
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>5}}}, "more"=>true} (via streamed from graphql-subscription:ac17fc47-fdf3-4951-813b-f4d04fdc7847)
|
486
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>6})
|
487
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzY\"}"
|
488
|
-
[ActionCable] Broadcasting to graphql-subscription:ac17fc47-fdf3-4951-813b-f4d04fdc7847: {:result=>{"data"=>{"payload"=>{"value"=>6}}}, :more=>true}
|
489
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>6}}}, "more"=>true} (via streamed from graphql-subscription:ac17fc47-fdf3-4951-813b-f4d04fdc7847)
|
490
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>1})
|
491
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzE\"}"
|
492
|
-
[ActionCable] Broadcasting to graphql-subscription:8642d019-1a8c-4eb9-ada2-7a5b1ccffeee: {:result=>{"data"=>{"payload"=>{"value"=>1}}}, :more=>true}
|
493
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>1}}}, "more"=>true} (via streamed from graphql-subscription:8642d019-1a8c-4eb9-ada2-7a5b1ccffeee)
|
494
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>2})
|
495
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzI\"}"
|
496
|
-
[ActionCable] Broadcasting to graphql-subscription:8642d019-1a8c-4eb9-ada2-7a5b1ccffeee: {:result=>{"data"=>{"payload"=>{"value"=>2}}}, :more=>true}
|
497
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>2}}}, "more"=>true} (via streamed from graphql-subscription:8642d019-1a8c-4eb9-ada2-7a5b1ccffeee)
|
498
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>3})
|
499
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzM\"}"
|
500
|
-
[ActionCable] Broadcasting to graphql-subscription:8642d019-1a8c-4eb9-ada2-7a5b1ccffeee: {:result=>{"data"=>{"payload"=>{"value"=>3}}}, :more=>true}
|
501
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>3}}}, "more"=>true} (via streamed from graphql-subscription:8642d019-1a8c-4eb9-ada2-7a5b1ccffeee)
|
502
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>4})
|
503
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "4x"
|
504
|
-
[ActionCable] Broadcasting to graphql-subscription:8642d019-1a8c-4eb9-ada2-7a5b1ccffeee: {:result=>{"data"=>{"payload"=>{"value"=>4}}}, :more=>true}
|
505
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>4}}}, "more"=>true} (via streamed from graphql-subscription:8642d019-1a8c-4eb9-ada2-7a5b1ccffeee)
|
506
|
-
Started GET "/" for 127.0.0.1 at 2017-11-16 21:30:10 -0500
|
507
|
-
Processing by PagesController#show as HTML
|
508
|
-
Rendering pages/show.html within layouts/application
|
509
|
-
Rendered pages/show.html within layouts/application (0.7ms)
|
510
|
-
Completed 200 OK in 12ms (Views: 10.1ms)
|
511
|
-
|
512
|
-
|
513
|
-
Started GET "/cable" for 127.0.0.1 at 2017-11-16 21:30:10 -0500
|
514
|
-
Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:30:10 -0500
|
515
|
-
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
|
516
|
-
GraphqlChannel is transmitting the subscription confirmation
|
517
|
-
GraphqlChannel is transmitting the subscription confirmation
|
518
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-2"}})
|
519
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
520
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-1"}})
|
521
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
522
|
-
GraphqlChannel is streaming from graphql-subscription:e33017bd-68e0-4443-81b9-cb2b750d345e
|
523
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-2
|
524
|
-
GraphqlChannel is streaming from graphql-subscription:ff9f5a68-c71c-4b5c-8135-cb902840a584
|
525
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-1
|
526
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>1})
|
527
|
-
dumping: #<GraphqlChannel::ExamplePayload:0x007fc09dee35f8>
|
528
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzE\"}"
|
529
|
-
Loading: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzE\"}"
|
530
|
-
[ActionCable] Broadcasting to graphql-subscription:ff9f5a68-c71c-4b5c-8135-cb902840a584: {:result=>{"data"=>{"payload"=>{"value"=>1}}}, :more=>true}
|
531
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>1}}}, "more"=>true} (via streamed from graphql-subscription:ff9f5a68-c71c-4b5c-8135-cb902840a584)
|
532
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>2})
|
533
|
-
dumping: #<GraphqlChannel::ExamplePayload:0x007fc09deb3330>
|
534
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzI\"}"
|
535
|
-
Loading: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzI\"}"
|
536
|
-
[ActionCable] Broadcasting to graphql-subscription:ff9f5a68-c71c-4b5c-8135-cb902840a584: {:result=>{"data"=>{"payload"=>{"value"=>2}}}, :more=>true}
|
537
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>2}}}, "more"=>true} (via streamed from graphql-subscription:ff9f5a68-c71c-4b5c-8135-cb902840a584)
|
538
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>3})
|
539
|
-
dumping: #<GraphqlChannel::ExamplePayload:0x007fc09de7b020>
|
540
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzM\"}"
|
541
|
-
Loading: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzM\"}"
|
542
|
-
[ActionCable] Broadcasting to graphql-subscription:ff9f5a68-c71c-4b5c-8135-cb902840a584: {:result=>{"data"=>{"payload"=>{"value"=>3}}}, :more=>true}
|
543
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>3}}}, "more"=>true} (via streamed from graphql-subscription:ff9f5a68-c71c-4b5c-8135-cb902840a584)
|
544
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>4})
|
545
|
-
dumping: #<GraphqlChannel::ExamplePayload:0x007fc09de41f78>
|
546
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "4x"
|
547
|
-
Loading: "4x"
|
548
|
-
[ActionCable] Broadcasting to graphql-subscription:ff9f5a68-c71c-4b5c-8135-cb902840a584: {:result=>{"data"=>{"payload"=>{"value"=>4}}}, :more=>true}
|
549
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>4}}}, "more"=>true} (via streamed from graphql-subscription:ff9f5a68-c71c-4b5c-8135-cb902840a584)
|
550
|
-
Started GET "/" for 127.0.0.1 at 2017-11-16 21:30:26 -0500
|
551
|
-
Processing by PagesController#show as HTML
|
552
|
-
Rendering pages/show.html within layouts/application
|
553
|
-
Rendered pages/show.html within layouts/application (0.3ms)
|
554
|
-
Completed 200 OK in 7ms (Views: 5.4ms)
|
555
|
-
|
556
|
-
|
557
|
-
Started GET "/cable" for 127.0.0.1 at 2017-11-16 21:30:27 -0500
|
558
|
-
Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:30:27 -0500
|
559
|
-
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
|
560
|
-
GraphqlChannel is transmitting the subscription confirmation
|
561
|
-
GraphqlChannel is transmitting the subscription confirmation
|
562
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-2"}})
|
563
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
564
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-1"}})
|
565
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-2
|
566
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
567
|
-
GraphqlChannel is streaming from graphql-subscription:ba2e384c-cbcf-4f9f-aa5e-8f666effd2a8
|
568
|
-
GraphqlChannel is streaming from graphql-subscription:18c8f852-04c7-4bb8-b6f7-ecc64a2a8ac9
|
569
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-1
|
570
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>1})
|
571
|
-
dumping: #<GraphqlChannel::ExamplePayload:0x007fc09e9fc660>
|
572
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzE\"}"
|
573
|
-
Loading: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzE\"}"
|
574
|
-
[ActionCable] Broadcasting to graphql-subscription:18c8f852-04c7-4bb8-b6f7-ecc64a2a8ac9: {:result=>{"data"=>{"payload"=>{"value"=>1}}}, :more=>true}
|
575
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>1}}}, "more"=>true} (via streamed from graphql-subscription:18c8f852-04c7-4bb8-b6f7-ecc64a2a8ac9)
|
576
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>2})
|
577
|
-
dumping: #<GraphqlChannel::ExamplePayload:0x007fc09dced938>
|
578
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzI\"}"
|
579
|
-
Loading: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzI\"}"
|
580
|
-
[ActionCable] Broadcasting to graphql-subscription:18c8f852-04c7-4bb8-b6f7-ecc64a2a8ac9: {:result=>{"data"=>{"payload"=>{"value"=>2}}}, :more=>true}
|
581
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>2}}}, "more"=>true} (via streamed from graphql-subscription:18c8f852-04c7-4bb8-b6f7-ecc64a2a8ac9)
|
582
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>3})
|
583
|
-
dumping: #<GraphqlChannel::ExamplePayload:0x007fc09e8c41d0>
|
584
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzM\"}"
|
585
|
-
Loading: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzM\"}"
|
586
|
-
[ActionCable] Broadcasting to graphql-subscription:18c8f852-04c7-4bb8-b6f7-ecc64a2a8ac9: {:result=>{"data"=>{"payload"=>{"value"=>3}}}, :more=>true}
|
587
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>3}}}, "more"=>true} (via streamed from graphql-subscription:18c8f852-04c7-4bb8-b6f7-ecc64a2a8ac9)
|
588
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>4})
|
589
|
-
dumping: #<GraphqlChannel::ExamplePayload:0x007fc09d407ad0>
|
590
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "4x"
|
591
|
-
Loading: "4x"
|
592
|
-
[ActionCable] Broadcasting to graphql-subscription:18c8f852-04c7-4bb8-b6f7-ecc64a2a8ac9: {:result=>{"data"=>{"payload"=>{"value"=>400}}}, :more=>true}
|
593
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>400}}}, "more"=>true} (via streamed from graphql-subscription:18c8f852-04c7-4bb8-b6f7-ecc64a2a8ac9)
|
594
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>5})
|
595
|
-
dumping: #<GraphqlChannel::ExamplePayload:0x007fc09dbbf250>
|
596
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzU\"}"
|
597
|
-
Loading: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzU\"}"
|
598
|
-
[ActionCable] Broadcasting to graphql-subscription:18c8f852-04c7-4bb8-b6f7-ecc64a2a8ac9: {:result=>{"data"=>{"payload"=>{"value"=>5}}}, :more=>true}
|
599
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>5}}}, "more"=>true} (via streamed from graphql-subscription:18c8f852-04c7-4bb8-b6f7-ecc64a2a8ac9)
|