code: func KnownTypeNamesRule(context *ValidationContext) *ValidationRuleInstance {
  	visitorOpts := &visitor.VisitorOptions{
  		KindFuncMap: map[string]visitor.NamedVisitFuncs{
  			kinds.ObjectDefinition: {
  				Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
  					return visitor.ActionSkip, nil
  				},
  			},
  			kinds.InterfaceDefinition: {
  				Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
  					return visitor.ActionSkip, nil
  				},
  			},
  			kinds.UnionDefinition: {
  				Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
  					return visitor.ActionSkip, nil
  				},
  			},
  			kinds.InputObjectDefinition: {
  				Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
  					return visitor.ActionSkip, nil
  				},
  			},
  			kinds.Named: {
  				Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
  					if node, ok := p.Node.(*ast.Named); ok {
  						typeNameValue := ""
  						typeName := node.Name
  						if typeName != nil {
  							typeNameValue = typeName.Value
  						}
  						ttype := context.Schema().Type(typeNameValue)
  						if ttype == nil {
  							suggestedTypes := []string{}
  							for key := range context.Schema().TypeMap() {
  								suggestedTypes = append(suggestedTypes, key)
  							}
  							reportError(
  								context,
  								unknownTypeMessage(typeNameValue, suggestionList(typeNameValue, suggestedTypes)),
  								[]ast.Node{node},
  							)
  						}
  					}
  					return visitor.ActionNoChange, nil
  				},
  			},
  		},
  	}
  	return &ValidationRuleInstance{
  		VisitorOpts: visitorOpts,
  	}
  }
docs: // KnownTypeNamesRule Known type names
  //
  // A GraphQL document is only valid if referenced types (specifically
  // variable definitions and fragment conditions) are defined by the type schema.