Sha256: 667dceb1939559cfcabf352f9198e5071f5d4cff74c3ba1428778228508c7721

Contents?: true

Size: 700 Bytes

Versions: 1

Compression:

Stored size: 700 Bytes

Contents

module GraphQL
  class Schema
    class FieldValidator
      def validate(field, errors)
        implementation = GraphQL::Schema::ImplementationValidator.new(field, as: "Field", errors: errors)
        implementation.must_respond_to(:name)
        implementation.must_respond_to(:type)
        implementation.must_respond_to(:description)
        implementation.must_respond_to(:arguments) do |arguments|
          validator = GraphQL::Schema::EachItemValidator.new(errors)
          validator.validate(arguments.keys, as: "#{field.name}.arguments keys", must_be: "Strings") { |k| k.is_a?(String) }
        end
        implementation.must_respond_to(:deprecation_reason)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
graphql-0.13.0 lib/graphql/schema/field_validator.rb