Module: GraphQL::StaticValidation::MutationRootExists
- Defined in:
- lib/graphql/static_validation/rules/mutation_root_exists.rb
Overview
-- @requires_ancestor: GraphQL::StaticValidation::BaseVisitor
Instance Method Summary collapse
-
#on_operation_definition(node, _parent) ⇒ Object
: (GraphQL::Language::Nodes::OperationDefinition node, GraphQL::Language::Nodes::AbstractNode? _parent) -> void.
Instance Method Details
#on_operation_definition(node, _parent) ⇒ Object
: (GraphQL::Language::Nodes::OperationDefinition node, GraphQL::Language::Nodes::AbstractNode? _parent) -> void
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/graphql/static_validation/rules/mutation_root_exists.rb', line 10 def on_operation_definition(node, _parent) if node.operation_type == 'mutation' && context.types.mutation_root.nil? add_error(GraphQL::StaticValidation::MutationRootExistsError.new( 'Schema is not configured for mutations', nodes: node )) else super end end |