Sha256: d9a283b272e4ecfb0ea03beabd168f79bb4a279a0de2f747a617ebb7a952c204
Contents?: true
Size: 623 Bytes
Versions: 8
Compression:
Stored size: 623 Bytes
Contents
module GraphQL module StaticValidation class SubscriptionRootExists include GraphQL::StaticValidation::Message::MessageHelper def validate(context) return if context.schema.subscription visitor = context.visitor visitor[GraphQL::Language::Nodes::OperationDefinition].enter << -> (ast_node, prev_ast_node) { if ast_node.operation_type == 'subscription' context.errors << message('Schema is not configured for subscriptions', ast_node, context: context) return GraphQL::Language::Visitor::SKIP end } end end end end
Version data entries
8 entries across 8 versions & 1 rubygems