code: def validate_sdl(
      document_ast: DocumentNode,
      schema_to_extend: GraphQLSchema = None,
      rules: Sequence[RuleType] = None,
  ) -> List[GraphQLError]:
      
      context = SDLValidationContext(document_ast, schema_to_extend)
      if rules is None:
          rules = specified_sdl_rules
      visitors = [rule(context) for rule in rules]
      visit(document_ast, ParallelVisitor(visitors))
      return context.errors
docs: Validate an SDL document.