lib/graphql/subscriptions.rb in graphql-2.1.6 vs lib/graphql/subscriptions.rb in graphql-2.1.7

- 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, "{ __typename }", validate: false, context: context) + dummy_query = @schema.query_class.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) @@ -232,10 +232,10 @@ Schema::Member::BuildType.camelize(event_or_arg_name.to_s) end # @return [Boolean] if true, then a query like this one would be broadcasted def broadcastable?(query_str, **query_options) - query = GraphQL::Query.new(@schema, query_str, **query_options) + query = @schema.query_class.new(@schema, query_str, **query_options) if !query.valid? raise "Invalid query: #{query.validation_errors.map(&:to_h).inspect}" end GraphQL::Analysis::AST.analyze_query(query, @schema.query_analyzers) query.context.namespace(:subscriptions)[:subscription_broadcastable]