code: func KnownFragmentNamesRule(context *ValidationContext) *ValidationRuleInstance {
  	visitorOpts := &visitor.VisitorOptions{
  		KindFuncMap: map[string]visitor.NamedVisitFuncs{
  			kinds.FragmentSpread: {
  				Kind: func(p visitor.VisitFuncParams) (string, interface{}) {
  					var action = visitor.ActionNoChange
  					var result interface{}
  					if node, ok := p.Node.(*ast.FragmentSpread); ok {
  
  						fragmentName := ""
  						if node.Name != nil {
  							fragmentName = node.Name.Value
  						}
  
  						fragment := context.Fragment(fragmentName)
  						if fragment == nil {
  							reportError(
  								context,
  								fmt.Sprintf(`Unknown fragment "%v".`, fragmentName),
  								[]ast.Node{node.Name},
  							)
  						}
  					}
  					return action, result
  				},
  			},
  		},
  	}
  	return &ValidationRuleInstance{
  		VisitorOpts: visitorOpts,
  	}
  }
docs: // KnownFragmentNamesRule Known fragment names
  //
  // A GraphQL document is only valid if all `...Fragment` fragment spreads refer
  // to fragments defined in the same document.