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