validateSchema function

List<ValidationError> validateSchema (
  1. Node schema
)

Validates a schema

Implementation

List<ValidationError> validateSchema(
  ast.Node schema,
) {
  final validator = _Validator(
    rules: {
      ValidationRule.uniqueDirectiveNames,
      ValidationRule.uniqueFieldDefinitionNames,
      ValidationRule.uniqueEnumValueNames,
      ValidationRule.loneSchemaDefinition,
      ValidationRule.uniqueOperationTypes,
      ValidationRule.uniqueTypeNames,
      ValidationRule.uniqueArgumentNames
    },
  );

  return validator.validate(
    node: schema,
  );
}