code: func UniqueInputFieldNamesRule(context *ValidationContext) *ValidationRuleInstance {
  	knownNameStack := []map[string]*ast.Name{}
  	knownNames := map[string]*ast.Name{}
  
  	visitorOpts := &visitor.VisitorOptions{
  		KindFuncMap: map[string]visitor.NamedVisitFuncs{
  			kinds.ObjectValue: {
  				Enter: func(p visitor.VisitFuncParams) (string, interface{}) {
  					knownNameStack = append(knownNameStack, knownNames)
  					knownNames = map[string]*ast.Name{}
  					return visitor.ActionNoChange, nil
  				},
  				Leave: func(p visitor.VisitFuncParams) (string, interface{}) {
  					// pop
  					knownNames, knownNameStack = knownNameStack[len(knownNameStack)-1], knownNameStack[:len(knownNameStack)-1]
  					return visitor.ActionNoChange, nil
  				},
  			},
  			kinds.ObjectField: {
  				Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
  					if node, ok := p.Node.(*ast.ObjectField); ok {
  						fieldName := ""
  						if node.Name != nil {
  							fieldName = node.Name.Value
  						}
  						if knownNameAST, ok := knownNames[fieldName]; ok {
  							reportError(
  								context,
  								fmt.Sprintf(`There can be only one input field named "%v".`, fieldName),
  								[]ast.Node{knownNameAST, node.Name},
  							)
  						} else {
  							knownNames[fieldName] = node.Name
  						}
  
  					}
  					return visitor.ActionSkip, nil
  				},
  			},
  		},
  	}
  	return &ValidationRuleInstance{
  		VisitorOpts: visitorOpts,
  	}
  }
docs: // UniqueInputFieldNamesRule Unique input field names
  //
  // A GraphQL input object value is only valid if all supplied fields are
  // uniquely named.