graphql 1.7.14 → 1.8.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/spec/dummy/log/test.log
CHANGED
@@ -808,207 +808,3 @@ Could not execute command from ({"command"=>"subscribe", "identifier"=>"{\"chann
|
|
808
808
|
^
|
809
809
|
/Users/rmosolgo/code/graphql-ruby/spec/dummy/app/channels/graphql_channel.rb:103: syntax error, unexpected end-of-input, expecting keyword_end]: /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:379:in `block in require_or_load'
|
810
810
|
Finished "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-13 21:58:53 -0500
|
811
|
-
-----------------------------------------------------------
|
812
|
-
ActionCableSubscriptionsTest: test_it_handles_subscriptions
|
813
|
-
-----------------------------------------------------------
|
814
|
-
Started GET "/" for 127.0.0.1 at 2017-11-16 21:25:41 -0500
|
815
|
-
Processing by PagesController#show as HTML
|
816
|
-
Rendering pages/show.html within layouts/application
|
817
|
-
Rendered pages/show.html within layouts/application (1.1ms)
|
818
|
-
Completed 200 OK in 169ms (Views: 167.8ms)
|
819
|
-
Started GET "/assets/application-aca150c4b2db51d5326af18134f6281fbce7e823a372b0337cca65ff41b4a7ea.js" for 127.0.0.1 at 2017-11-16 21:25:41 -0500
|
820
|
-
Started GET "/cable" for 127.0.0.1 at 2017-11-16 21:25:42 -0500
|
821
|
-
Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:25:42 -0500
|
822
|
-
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
|
823
|
-
GraphqlChannel is transmitting the subscription confirmation
|
824
|
-
GraphqlChannel is transmitting the subscription confirmation
|
825
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-1"}})
|
826
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
827
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-2"}})
|
828
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
829
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-1
|
830
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-2
|
831
|
-
GraphqlChannel is streaming from graphql-subscription:2d85fcfd-550d-45ce-9b98-71d4adc0dcc0
|
832
|
-
GraphqlChannel is streaming from graphql-subscription:a225c15d-b0a3-4bdf-b535-e6e5e937cc25
|
833
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>1})
|
834
|
-
Could not execute command from ({"command"=>"message", "identifier"=>"{\"channel\":\"GraphqlChannel\",\"id\":\"15fc7cbd4ad\"}", "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'
|
835
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>2})
|
836
|
-
Could not execute command from ({"command"=>"message", "identifier"=>"{\"channel\":\"GraphqlChannel\",\"id\":\"15fc7cbd4ad\"}", "data"=>"{\"id\":\"updates-1\",\"value\":2,\"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'
|
837
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>3})
|
838
|
-
Could not execute command from ({"command"=>"message", "identifier"=>"{\"channel\":\"GraphqlChannel\",\"id\":\"15fc7cbd4ad\"}", "data"=>"{\"id\":\"updates-1\",\"value\":3,\"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'
|
839
|
-
Finished "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:25:45 -0500
|
840
|
-
GraphqlChannel stopped streaming from graphql-subscription:2d85fcfd-550d-45ce-9b98-71d4adc0dcc0
|
841
|
-
GraphqlChannel stopped streaming from graphql-event::payload:id:updates-1
|
842
|
-
GraphqlChannel stopped streaming from graphql-subscription:a225c15d-b0a3-4bdf-b535-e6e5e937cc25
|
843
|
-
GraphqlChannel stopped streaming from graphql-event::payload:id:updates-2
|
844
|
-
-----------------------------------------------------------
|
845
|
-
ActionCableSubscriptionsTest: test_it_handles_subscriptions
|
846
|
-
-----------------------------------------------------------
|
847
|
-
Started GET "/" for 127.0.0.1 at 2017-11-16 21:31:11 -0500
|
848
|
-
Processing by PagesController#show as HTML
|
849
|
-
Rendering pages/show.html within layouts/application
|
850
|
-
Rendered pages/show.html within layouts/application (0.7ms)
|
851
|
-
Completed 200 OK in 138ms (Views: 136.5ms)
|
852
|
-
Started GET "/assets/application-aca150c4b2db51d5326af18134f6281fbce7e823a372b0337cca65ff41b4a7ea.js" for 127.0.0.1 at 2017-11-16 21:31:11 -0500
|
853
|
-
Started GET "/cable" for 127.0.0.1 at 2017-11-16 21:31:11 -0500
|
854
|
-
Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:31:11 -0500
|
855
|
-
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
|
856
|
-
GraphqlChannel is transmitting the subscription confirmation
|
857
|
-
GraphqlChannel is transmitting the subscription confirmation
|
858
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-1"}})
|
859
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
860
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-2"}})
|
861
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
862
|
-
GraphqlChannel is streaming from graphql-subscription:17acca37-2b4d-448c-b9bb-51ce54d11284
|
863
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-1
|
864
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-2
|
865
|
-
GraphqlChannel is streaming from graphql-subscription:606ac42b-b06b-4d48-9f1e-0a82a7c313b0
|
866
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>1})
|
867
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzE\"}"
|
868
|
-
[ActionCable] Broadcasting to graphql-subscription:17acca37-2b4d-448c-b9bb-51ce54d11284: {:result=>{"data"=>{"payload"=>{"value"=>1}}}, :more=>true}
|
869
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>1}}}, "more"=>true} (via streamed from graphql-subscription:17acca37-2b4d-448c-b9bb-51ce54d11284)
|
870
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>2})
|
871
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzI\"}"
|
872
|
-
[ActionCable] Broadcasting to graphql-subscription:17acca37-2b4d-448c-b9bb-51ce54d11284: {:result=>{"data"=>{"payload"=>{"value"=>2}}}, :more=>true}
|
873
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>2}}}, "more"=>true} (via streamed from graphql-subscription:17acca37-2b4d-448c-b9bb-51ce54d11284)
|
874
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>3})
|
875
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzM\"}"
|
876
|
-
[ActionCable] Broadcasting to graphql-subscription:17acca37-2b4d-448c-b9bb-51ce54d11284: {:result=>{"data"=>{"payload"=>{"value"=>3}}}, :more=>true}
|
877
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>3}}}, "more"=>true} (via streamed from graphql-subscription:17acca37-2b4d-448c-b9bb-51ce54d11284)
|
878
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>1})
|
879
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzE\"}"
|
880
|
-
[ActionCable] Broadcasting to graphql-subscription:606ac42b-b06b-4d48-9f1e-0a82a7c313b0: {:result=>{"data"=>{"payload"=>{"value"=>1}}}, :more=>true}
|
881
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>1}}}, "more"=>true} (via streamed from graphql-subscription:606ac42b-b06b-4d48-9f1e-0a82a7c313b0)
|
882
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>2})
|
883
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzI\"}"
|
884
|
-
[ActionCable] Broadcasting to graphql-subscription:606ac42b-b06b-4d48-9f1e-0a82a7c313b0: {:result=>{"data"=>{"payload"=>{"value"=>2}}}, :more=>true}
|
885
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>2}}}, "more"=>true} (via streamed from graphql-subscription:606ac42b-b06b-4d48-9f1e-0a82a7c313b0)
|
886
|
-
Unsubscribing from channel: {"channel":"GraphqlChannel","id":"15fc7d184bc"}
|
887
|
-
GraphqlChannel stopped streaming from graphql-subscription:17acca37-2b4d-448c-b9bb-51ce54d11284
|
888
|
-
GraphqlChannel stopped streaming from graphql-event::payload:id:updates-1
|
889
|
-
Could not execute command from ({"command"=>"message", "identifier"=>"{\"channel\":\"GraphqlChannel\",\"id\":\"15fc7d184bc\"}", "data"=>"{\"id\":\"updates-1\",\"value\":4,\"action\":\"make_trigger\"}"}) [RuntimeError - Unable to find subscription with identifier: {"channel":"GraphqlChannel","id":"15fc7d184bc"}]: /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:76:in `find' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:53:in `perform_action' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:17:in `execute_command' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/base.rb:85:in `dispatch_websocket_message' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/server/worker.rb:58:in `block in invoke'
|
890
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>3})
|
891
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzM\"}"
|
892
|
-
[ActionCable] Broadcasting to graphql-subscription:606ac42b-b06b-4d48-9f1e-0a82a7c313b0: {:result=>{"data"=>{"payload"=>{"value"=>3}}}, :more=>true}
|
893
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>3}}}, "more"=>true} (via streamed from graphql-subscription:606ac42b-b06b-4d48-9f1e-0a82a7c313b0)
|
894
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>4})
|
895
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "4x"
|
896
|
-
[ActionCable] Broadcasting to graphql-subscription:606ac42b-b06b-4d48-9f1e-0a82a7c313b0: {:result=>{"data"=>{"payload"=>{"value"=>400}}}, :more=>true}
|
897
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>400}}}, "more"=>true} (via streamed from graphql-subscription:606ac42b-b06b-4d48-9f1e-0a82a7c313b0)
|
898
|
-
Finished "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:31:15 -0500
|
899
|
-
GraphqlChannel stopped streaming from graphql-subscription:606ac42b-b06b-4d48-9f1e-0a82a7c313b0
|
900
|
-
GraphqlChannel stopped streaming from graphql-event::payload:id:updates-2
|
901
|
-
-----------------------------------------------------------
|
902
|
-
ActionCableSubscriptionsTest: test_it_handles_subscriptions
|
903
|
-
-----------------------------------------------------------
|
904
|
-
Started GET "/" for 127.0.0.1 at 2017-11-16 21:31:35 -0500
|
905
|
-
Processing by PagesController#show as HTML
|
906
|
-
Rendering pages/show.html within layouts/application
|
907
|
-
Rendered pages/show.html within layouts/application (2.2ms)
|
908
|
-
Completed 200 OK in 195ms (Views: 194.0ms)
|
909
|
-
Started GET "/assets/application-aca150c4b2db51d5326af18134f6281fbce7e823a372b0337cca65ff41b4a7ea.js" for 127.0.0.1 at 2017-11-16 21:31:35 -0500
|
910
|
-
Started GET "/cable" for 127.0.0.1 at 2017-11-16 21:31:35 -0500
|
911
|
-
Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:31:35 -0500
|
912
|
-
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
|
913
|
-
GraphqlChannel is transmitting the subscription confirmation
|
914
|
-
GraphqlChannel is transmitting the subscription confirmation
|
915
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-2"}})
|
916
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
917
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-1"}})
|
918
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
919
|
-
GraphqlChannel is streaming from graphql-subscription:deb86012-88c0-4449-872c-f71c390a3c11
|
920
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-2
|
921
|
-
GraphqlChannel is streaming from graphql-subscription:ded77eba-1a76-4246-83f2-bd4637b11de0
|
922
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-1
|
923
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>1})
|
924
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzE\"}"
|
925
|
-
[ActionCable] Broadcasting to graphql-subscription:ded77eba-1a76-4246-83f2-bd4637b11de0: {:result=>{"data"=>{"payload"=>{"value"=>1}}}, :more=>true}
|
926
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>1}}}, "more"=>true} (via streamed from graphql-subscription:ded77eba-1a76-4246-83f2-bd4637b11de0)
|
927
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>2})
|
928
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzI\"}"
|
929
|
-
[ActionCable] Broadcasting to graphql-subscription:ded77eba-1a76-4246-83f2-bd4637b11de0: {:result=>{"data"=>{"payload"=>{"value"=>2}}}, :more=>true}
|
930
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>2}}}, "more"=>true} (via streamed from graphql-subscription:ded77eba-1a76-4246-83f2-bd4637b11de0)
|
931
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>3})
|
932
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzM\"}"
|
933
|
-
[ActionCable] Broadcasting to graphql-subscription:ded77eba-1a76-4246-83f2-bd4637b11de0: {:result=>{"data"=>{"payload"=>{"value"=>3}}}, :more=>true}
|
934
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>3}}}, "more"=>true} (via streamed from graphql-subscription:ded77eba-1a76-4246-83f2-bd4637b11de0)
|
935
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>1})
|
936
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzE\"}"
|
937
|
-
[ActionCable] Broadcasting to graphql-subscription:deb86012-88c0-4449-872c-f71c390a3c11: {:result=>{"data"=>{"payload"=>{"value"=>1}}}, :more=>true}
|
938
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>1}}}, "more"=>true} (via streamed from graphql-subscription:deb86012-88c0-4449-872c-f71c390a3c11)
|
939
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>2})
|
940
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzI\"}"
|
941
|
-
[ActionCable] Broadcasting to graphql-subscription:deb86012-88c0-4449-872c-f71c390a3c11: {:result=>{"data"=>{"payload"=>{"value"=>2}}}, :more=>true}
|
942
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>2}}}, "more"=>true} (via streamed from graphql-subscription:deb86012-88c0-4449-872c-f71c390a3c11)
|
943
|
-
Unsubscribing from channel: {"channel":"GraphqlChannel","id":"15fc7d19ae3"}
|
944
|
-
GraphqlChannel stopped streaming from graphql-subscription:ded77eba-1a76-4246-83f2-bd4637b11de0
|
945
|
-
GraphqlChannel stopped streaming from graphql-event::payload:id:updates-1
|
946
|
-
Could not execute command from ({"command"=>"message", "identifier"=>"{\"channel\":\"GraphqlChannel\",\"id\":\"15fc7d19ae3\"}", "data"=>"{\"id\":\"updates-1\",\"value\":4,\"action\":\"make_trigger\"}"}) [RuntimeError - Unable to find subscription with identifier: {"channel":"GraphqlChannel","id":"15fc7d19ae3"}]: /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:76:in `find' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:53:in `perform_action' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:17:in `execute_command' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/base.rb:85:in `dispatch_websocket_message' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/server/worker.rb:58:in `block in invoke'
|
947
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>3})
|
948
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzM\"}"
|
949
|
-
[ActionCable] Broadcasting to graphql-subscription:deb86012-88c0-4449-872c-f71c390a3c11: {:result=>{"data"=>{"payload"=>{"value"=>3}}}, :more=>true}
|
950
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>3}}}, "more"=>true} (via streamed from graphql-subscription:deb86012-88c0-4449-872c-f71c390a3c11)
|
951
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>4})
|
952
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "4x"
|
953
|
-
[ActionCable] Broadcasting to graphql-subscription:deb86012-88c0-4449-872c-f71c390a3c11: {:result=>{"data"=>{"payload"=>{"value"=>400}}}, :more=>true}
|
954
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>400}}}, "more"=>true} (via streamed from graphql-subscription:deb86012-88c0-4449-872c-f71c390a3c11)
|
955
|
-
Finished "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:31:41 -0500
|
956
|
-
GraphqlChannel stopped streaming from graphql-subscription:deb86012-88c0-4449-872c-f71c390a3c11
|
957
|
-
GraphqlChannel stopped streaming from graphql-event::payload:id:updates-2
|
958
|
-
-----------------------------------------------------------
|
959
|
-
ActionCableSubscriptionsTest: test_it_handles_subscriptions
|
960
|
-
-----------------------------------------------------------
|
961
|
-
Started GET "/" for 127.0.0.1 at 2017-11-16 21:31:55 -0500
|
962
|
-
Processing by PagesController#show as HTML
|
963
|
-
Rendering pages/show.html within layouts/application
|
964
|
-
Rendered pages/show.html within layouts/application (1.0ms)
|
965
|
-
Completed 200 OK in 111ms (Views: 110.0ms)
|
966
|
-
Started GET "/assets/application-aca150c4b2db51d5326af18134f6281fbce7e823a372b0337cca65ff41b4a7ea.js" for 127.0.0.1 at 2017-11-16 21:31:55 -0500
|
967
|
-
Started GET "/cable" for 127.0.0.1 at 2017-11-16 21:31:56 -0500
|
968
|
-
Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:31:56 -0500
|
969
|
-
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
|
970
|
-
GraphqlChannel is transmitting the subscription confirmation
|
971
|
-
GraphqlChannel is transmitting the subscription confirmation
|
972
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-2"}})
|
973
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
974
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-2
|
975
|
-
GraphqlChannel#execute({"query"=>"subscription($id: ID!) { payload(id: $id) { value } }", "variables"=>{"id"=>"updates-1"}})
|
976
|
-
GraphqlChannel is streaming from graphql-subscription:4aa99f83-32cb-4a2f-a337-ebfa958ad4f9
|
977
|
-
GraphqlChannel transmitting {:result=>{"data"=>nil}, :more=>true}
|
978
|
-
GraphqlChannel is streaming from graphql-subscription:359ce997-f8e7-4431-bd71-74af6276e37e
|
979
|
-
GraphqlChannel is streaming from graphql-event::payload:id:updates-1
|
980
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>1})
|
981
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzE\"}"
|
982
|
-
[ActionCable] Broadcasting to graphql-subscription:359ce997-f8e7-4431-bd71-74af6276e37e: {:result=>{"data"=>{"payload"=>{"value"=>1}}}, :more=>true}
|
983
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>1}}}, "more"=>true} (via streamed from graphql-subscription:359ce997-f8e7-4431-bd71-74af6276e37e)
|
984
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>2})
|
985
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzI\"}"
|
986
|
-
[ActionCable] Broadcasting to graphql-subscription:359ce997-f8e7-4431-bd71-74af6276e37e: {:result=>{"data"=>{"payload"=>{"value"=>2}}}, :more=>true}
|
987
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>2}}}, "more"=>true} (via streamed from graphql-subscription:359ce997-f8e7-4431-bd71-74af6276e37e)
|
988
|
-
GraphqlChannel#make_trigger({"id"=>"updates-1", "value"=>3})
|
989
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-1: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzM\"}"
|
990
|
-
[ActionCable] Broadcasting to graphql-subscription:359ce997-f8e7-4431-bd71-74af6276e37e: {:result=>{"data"=>{"payload"=>{"value"=>3}}}, :more=>true}
|
991
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>3}}}, "more"=>true} (via streamed from graphql-subscription:359ce997-f8e7-4431-bd71-74af6276e37e)
|
992
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>1})
|
993
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzE\"}"
|
994
|
-
[ActionCable] Broadcasting to graphql-subscription:4aa99f83-32cb-4a2f-a337-ebfa958ad4f9: {:result=>{"data"=>{"payload"=>{"value"=>1}}}, :more=>true}
|
995
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>1}}}, "more"=>true} (via streamed from graphql-subscription:4aa99f83-32cb-4a2f-a337-ebfa958ad4f9)
|
996
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>2})
|
997
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzI\"}"
|
998
|
-
[ActionCable] Broadcasting to graphql-subscription:4aa99f83-32cb-4a2f-a337-ebfa958ad4f9: {:result=>{"data"=>{"payload"=>{"value"=>2}}}, :more=>true}
|
999
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>2}}}, "more"=>true} (via streamed from graphql-subscription:4aa99f83-32cb-4a2f-a337-ebfa958ad4f9)
|
1000
|
-
Unsubscribing from channel: {"channel":"GraphqlChannel","id":"15fc7d1abf4"}
|
1001
|
-
GraphqlChannel stopped streaming from graphql-subscription:359ce997-f8e7-4431-bd71-74af6276e37e
|
1002
|
-
GraphqlChannel stopped streaming from graphql-event::payload:id:updates-1
|
1003
|
-
Could not execute command from ({"command"=>"message", "identifier"=>"{\"channel\":\"GraphqlChannel\",\"id\":\"15fc7d1abf4\"}", "data"=>"{\"id\":\"updates-1\",\"value\":4,\"action\":\"make_trigger\"}"}) [RuntimeError - Unable to find subscription with identifier: {"channel":"GraphqlChannel","id":"15fc7d1abf4"}]: /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:76:in `find' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:53:in `perform_action' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/subscriptions.rb:17:in `execute_command' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/connection/base.rb:85:in `dispatch_websocket_message' | /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/action_cable/server/worker.rb:58:in `block in invoke'
|
1004
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>3})
|
1005
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "{\"__gid__\":\"Z2lkOi8vZHVtbXkvR3JhcGhxbENoYW5uZWw6OkV4YW1wbGVQYXlsb2FkLzM\"}"
|
1006
|
-
[ActionCable] Broadcasting to graphql-subscription:4aa99f83-32cb-4a2f-a337-ebfa958ad4f9: {:result=>{"data"=>{"payload"=>{"value"=>3}}}, :more=>true}
|
1007
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>3}}}, "more"=>true} (via streamed from graphql-subscription:4aa99f83-32cb-4a2f-a337-ebfa958ad4f9)
|
1008
|
-
GraphqlChannel#make_trigger({"id"=>"updates-2", "value"=>4})
|
1009
|
-
[ActionCable] Broadcasting to graphql-event::payload:id:updates-2: "4x"
|
1010
|
-
[ActionCable] Broadcasting to graphql-subscription:4aa99f83-32cb-4a2f-a337-ebfa958ad4f9: {:result=>{"data"=>{"payload"=>{"value"=>400}}}, :more=>true}
|
1011
|
-
GraphqlChannel transmitting {"result"=>{"data"=>{"payload"=>{"value"=>400}}}, "more"=>true} (via streamed from graphql-subscription:4aa99f83-32cb-4a2f-a337-ebfa958ad4f9)
|
1012
|
-
Finished "/cable/" [WebSocket] for 127.0.0.1 at 2017-11-16 21:31:59 -0500
|
1013
|
-
GraphqlChannel stopped streaming from graphql-subscription:4aa99f83-32cb-4a2f-a337-ebfa958ad4f9
|
1014
|
-
GraphqlChannel stopped streaming from graphql-event::payload:id:updates-2
|
@@ -37,9 +37,5 @@ class ActionCableSubscriptionsTest < ApplicationSystemTestCase
|
|
37
37
|
click_on("Trigger 2")
|
38
38
|
assert_selector "#updates-2-3", text: "3"
|
39
39
|
refute_selector "#updates-1-4"
|
40
|
-
|
41
|
-
# wacky behavior to make sure the custom serializer is used:
|
42
|
-
click_on("Trigger 2")
|
43
|
-
assert_selector "#updates-2-400", text: "400"
|
44
40
|
end
|
45
41
|
end
|
Binary file
|
@@ -30,30 +30,4 @@ RUBY
|
|
30
30
|
|
31
31
|
assert_file "app/graphql/functions/find_record.rb", expected_content
|
32
32
|
end
|
33
|
-
|
34
|
-
test "it generates a namespaced function by name" do
|
35
|
-
run_generator(["finders::find_record"])
|
36
|
-
|
37
|
-
expected_content = <<-RUBY
|
38
|
-
class Functions::Finders::FindRecord < GraphQL::Function
|
39
|
-
# Define `initialize` to store field-level options, eg
|
40
|
-
#
|
41
|
-
# field :myField, function: Functions::Finders::FindRecord.new(type: MyType)
|
42
|
-
#
|
43
|
-
# attr_reader :type
|
44
|
-
# def initialize(type:)
|
45
|
-
# @type = type
|
46
|
-
# end
|
47
|
-
|
48
|
-
# add arguments by type:
|
49
|
-
# argument :id, !types.ID
|
50
|
-
|
51
|
-
# Resolve function:
|
52
|
-
def call(obj, args, ctx)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
RUBY
|
56
|
-
|
57
|
-
assert_file "app/graphql/functions/finders/find_record.rb", expected_content
|
58
|
-
end
|
59
33
|
end
|
@@ -28,28 +28,4 @@ RUBY
|
|
28
28
|
|
29
29
|
assert_file "app/graphql/loaders/record_loader.rb", expected_content
|
30
30
|
end
|
31
|
-
|
32
|
-
test "it generates a namespaced loader by name" do
|
33
|
-
run_generator(["active_record::record_loader"])
|
34
|
-
|
35
|
-
expected_content = <<-RUBY
|
36
|
-
class Loaders::ActiveRecord::RecordLoader < GraphQL::Batch::Loader
|
37
|
-
# Define `initialize` to store grouping arguments, eg
|
38
|
-
#
|
39
|
-
# Loaders::ActiveRecord::RecordLoader.for(group).load(value)
|
40
|
-
#
|
41
|
-
# def initialize()
|
42
|
-
# end
|
43
|
-
|
44
|
-
# `keys` contains each key from `.load(key)`.
|
45
|
-
# Find the corresponding values, then
|
46
|
-
# call `fulfill(key, value)` or `fulfill(key, nil)`
|
47
|
-
# for each key.
|
48
|
-
def perform(keys)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
RUBY
|
52
|
-
|
53
|
-
assert_file "app/graphql/loaders/active_record/record_loader.rb", expected_content
|
54
|
-
end
|
55
31
|
end
|
@@ -37,7 +37,7 @@ describe GraphQL::Analysis::MaxQueryComplexity do
|
|
37
37
|
Dummy::Schema.max_complexity = nil
|
38
38
|
end
|
39
39
|
it "doesn't error" do
|
40
|
-
|
40
|
+
assert_equal nil, result["errors"]
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -46,7 +46,7 @@ describe GraphQL::Analysis::MaxQueryComplexity do
|
|
46
46
|
Dummy::Schema.max_complexity = 99
|
47
47
|
end
|
48
48
|
it "doesn't error" do
|
49
|
-
|
49
|
+
assert_equal nil, result["errors"]
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -68,7 +68,7 @@ describe GraphQL::Analysis::MaxQueryComplexity do
|
|
68
68
|
let(:result) { Dummy::Schema.execute(query_string, max_complexity: 10) }
|
69
69
|
|
70
70
|
it "doesn't error" do
|
71
|
-
|
71
|
+
assert_equal nil, result["errors"]
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
@@ -39,7 +39,7 @@ describe GraphQL::Analysis::MaxQueryDepth do
|
|
39
39
|
let(:result) { Dummy::Schema.execute(query_string, max_depth: 100) }
|
40
40
|
|
41
41
|
it "obeys that max_depth" do
|
42
|
-
|
42
|
+
assert_equal nil, result["errors"]
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
@@ -49,7 +49,7 @@ describe GraphQL::Analysis::MaxQueryDepth do
|
|
49
49
|
end
|
50
50
|
|
51
51
|
it "doesn't add an error" do
|
52
|
-
|
52
|
+
assert_equal nil, result["errors"]
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
@@ -59,7 +59,7 @@ describe GraphQL::Analysis::MaxQueryDepth do
|
|
59
59
|
end
|
60
60
|
|
61
61
|
it "doesn't add an error message" do
|
62
|
-
|
62
|
+
assert_equal nil, result["errors"]
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
@@ -126,16 +126,6 @@ describe GraphQL::Backtrace do
|
|
126
126
|
assert_includes err.message, "more lines"
|
127
127
|
end
|
128
128
|
|
129
|
-
it "annotates errors from Query#result" do
|
130
|
-
query_str = "query StrField { field2 { strField } __typename }"
|
131
|
-
context = { backtrace: true }
|
132
|
-
query = GraphQL::Query.new(schema, query_str, context: context)
|
133
|
-
err = assert_raises(GraphQL::Backtrace::TracedError) {
|
134
|
-
query.result
|
135
|
-
}
|
136
|
-
assert_instance_of RuntimeError, err.cause
|
137
|
-
end
|
138
|
-
|
139
129
|
it "annotates errors inside lazy resolution" do
|
140
130
|
# Test context-based flag
|
141
131
|
err = assert_raises(GraphQL::Backtrace::TracedError) {
|
@@ -28,25 +28,11 @@ describe GraphQL::BaseType do
|
|
28
28
|
assert_equal ["Cheese"], Dummy::CheeseType.metadata[:class_names]
|
29
29
|
end
|
30
30
|
|
31
|
-
describe "
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
it "is invalid" do
|
38
|
-
assert_raises(GraphQL::InvalidNameError) { BaseNameSpaceTest.name }
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
describe "when containing colons" do
|
43
|
-
BaseNameColonsTest = GraphQL::BaseType.define do
|
44
|
-
name "Some::Invalid::Name"
|
45
|
-
end
|
46
|
-
|
47
|
-
it 'is invalid' do
|
48
|
-
assert_raises(GraphQL::InvalidNameError) { BaseNameColonsTest.name }
|
49
|
-
end
|
31
|
+
describe "forwards-compat with new api" do
|
32
|
+
let(:type_defn) { Dummy::CheeseType }
|
33
|
+
it "responds to new methods" do
|
34
|
+
assert_equal "Cheese", type_defn.graphql_name
|
35
|
+
assert_equal type_defn, type_defn.graphql_definition
|
50
36
|
end
|
51
37
|
end
|
52
38
|
|
@@ -13,9 +13,9 @@ describe GraphQL::BOOLEAN_TYPE do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it "rejects other types" do
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
assert_equal nil, coerce_input("true")
|
17
|
+
assert_equal nil, coerce_input(5.5)
|
18
|
+
assert_equal nil, coerce_input(nil)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -37,34 +37,21 @@ describe GraphQL::EnumType do
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
describe "invalid
|
41
|
-
it "rejects
|
40
|
+
describe "invalid names" do
|
41
|
+
it "rejects names with a space" do
|
42
42
|
assert_raises(GraphQL::InvalidNameError) {
|
43
|
-
|
44
|
-
name "
|
43
|
+
InvalidEnumTest = GraphQL::EnumType.define do
|
44
|
+
name "InvalidEnumTest"
|
45
45
|
|
46
46
|
value("SPACE IN VALUE", "Invalid enum because it contains spaces", value: 1)
|
47
47
|
end
|
48
48
|
|
49
49
|
# Force evaluation
|
50
|
-
|
50
|
+
InvalidEnumTest.name
|
51
51
|
}
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
describe "invalid name" do
|
56
|
-
it "reject names with invalid format" do
|
57
|
-
assert_raises(GraphQL::InvalidNameError) do
|
58
|
-
InvalidEnumNameTest = GraphQL::EnumType.define do
|
59
|
-
name "Some::Invalid::Name"
|
60
|
-
end
|
61
|
-
|
62
|
-
# Force evaluation
|
63
|
-
InvalidEnumNameTest.name
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
55
|
describe "values that are Arrays" do
|
69
56
|
let(:schema) {
|
70
57
|
enum = GraphQL::EnumType.define do
|