Sha256: 5a4429ccfa8235b245c08b77bfe8b33fffabef1c01dd166a187a16579bff49f5

Contents?: true

Size: 510 Bytes

Versions: 173

Compression:

Stored size: 510 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module StaticValidation
    module SubscriptionRootExists
      def on_operation_definition(node, _parent)
        if node.operation_type == "subscription" && context.warden.root_type_for_operation("subscription").nil?
          add_error(GraphQL::StaticValidation::SubscriptionRootExistsError.new(
            'Schema is not configured for subscriptions',
            nodes: node
          ))
        else
          super
        end
      end
    end
  end
end

Version data entries

173 entries across 173 versions & 2 rubygems

Version Path
graphql-2.2.7 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.6 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.1.11 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.0.28 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-1.13.21 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.5 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.4 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.3 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.1.10 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.2 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.1.9 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.1 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.0 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.1.8 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.1.7 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.1.6 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.1.5 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.1.4 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-1.13.20 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.1.3 lib/graphql/static_validation/rules/subscription_root_exists.rb