code: func UniqueFragmentNamesRule(context *ValidationContext) *ValidationRuleInstance {
  	knownFragmentNames := map[string]*ast.Name{}
  
  	visitorOpts := &visitor.VisitorOptions{
  		KindFuncMap: map[string]visitor.NamedVisitFuncs{
  			kinds.OperationDefinition: {
  				Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
  					return visitor.ActionSkip, nil
  				},
  			},
  			kinds.FragmentDefinition: {
  				Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
  					if node, ok := p.Node.(*ast.FragmentDefinition); ok && node != nil {
  						fragmentName := ""
  						if node.Name != nil {
  							fragmentName = node.Name.Value
  						}
  						if nameAST, ok := knownFragmentNames[fragmentName]; ok {
  							reportError(
  								context,
  								fmt.Sprintf(`There can only be one fragment named "%v".`, fragmentName),
  								[]ast.Node{nameAST, node.Name},
  							)
  						} else {
  							knownFragmentNames[fragmentName] = node.Name
  						}
  					}
  					return visitor.ActionSkip, nil
  				},
  			},
  		},
  	}
  	return &ValidationRuleInstance{
  		VisitorOpts: visitorOpts,
  	}
  }
docs: // UniqueFragmentNamesRule Unique fragment names
  //
  // A GraphQL document is only valid if all defined fragments have unique names.