lib/graphql/subscriptions.rb in graphql-2.1.3 vs lib/graphql/subscriptions.rb in graphql-2.1.4

- old
+ new

@@ -60,11 +60,11 @@ # @param scope [Symbol, String] # @param context [Hash] # @return [void] def trigger(event_name, args, object, scope: nil, context: {}) # Make something as context-like as possible, even though there isn't a current query: - dummy_query = GraphQL::Query.new(@schema, "", validate: false, context: context) + dummy_query = GraphQL::Query.new(@schema, "{ __typename }", validate: false, context: context) context = dummy_query.context event_name = event_name.to_s # Try with the verbatim input first: field = @schema.get_field(@schema.subscription, event_name, context) @@ -81,10 +81,10 @@ normalized_event_name = event_name end # Normalize symbol-keyed args to strings, try camelizing them # Should this accept a real context somehow? - normalized_args = normalize_arguments(normalized_event_name, field, args, GraphQL::Query::NullContext) + normalized_args = normalize_arguments(normalized_event_name, field, args, GraphQL::Query::NullContext.instance) event = Subscriptions::Event.new( name: normalized_event_name, arguments: normalized_args, field: field,