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.16 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.1.13 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.3.7 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.3.6 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.3.5 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.0.31 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.3.2 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.3.1 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-1.13.23 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.3.0 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.14 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.13 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.12 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.0.29 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.1.12 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-1.13.22 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.11 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.10 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.9 lib/graphql/static_validation/rules/subscription_root_exists.rb
graphql-2.2.8 lib/graphql/static_validation/rules/subscription_root_exists.rb