private void ValidateDirectiveAreUniquePerLocation <T>(
     T node,
     IDocumentValidatorContext context)
     where T : ISyntaxNode, Language.IHasDirectives
 {
     context.Names.Clear();
     foreach (DirectiveNode directive in node.Directives)
     {
         if (context.Schema.TryGetDirectiveType(directive.Name.Value, out DirectiveType? dt) &&
             !dt.IsRepeatable &&
             !context.Names.Add(directive.Name.Value))
         {
             context.Errors.Add(context.DirectiveMustBeUniqueInLocation(directive));
         }
     }
 }