Sha256: f6f9431f45fd2ea014c8378d0961111929724eacaa05849b03d00f39c5ffc43c

Contents?: true

Size: 490 Bytes

Versions: 173

Compression:

Stored size: 490 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module StaticValidation
    module MutationRootExists
      def on_operation_definition(node, _parent)
        if node.operation_type == 'mutation' && context.warden.root_type_for_operation("mutation").nil?
          add_error(GraphQL::StaticValidation::MutationRootExistsError.new(
            'Schema is not configured for mutations',
            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/mutation_root_exists.rb
graphql-2.1.13 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.3.7 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.3.6 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.3.5 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.0.31 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.3.2 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.3.1 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-1.13.23 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.3.0 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.2.14 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.2.13 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.2.12 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.0.29 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.1.12 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-1.13.22 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.2.11 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.2.10 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.2.9 lib/graphql/static_validation/rules/mutation_root_exists.rb
graphql-2.2.8 lib/graphql/static_validation/rules/mutation_root_exists.rb