code: function findCanonicalNodeWithPath (graph, node, locale, path) {
    if (locale === preferredLocale) {
      if (isCanonicalNode(node)) {
        // We found it.
        return [{ node, locale: preferredLocale, path }]
      } else {
        // Get all the linked nodes.
        var linkedNodes = node.edges.from.map(nodeFromCurie => graph[nodeFromCurie])
        // Find the canonical nodes for each one of them.
        return linkedNodes.reduce((canonicalNodes, linkedNode) => {
          return canonicalNodes.concat(findCanonicalNodeWithPath(
            graph,
            linkedNode,
            preferredLocale,
            path.concat([{ node, locale: preferredLocale }])
          ))
        }, [])
      }
    } else {
      // If not the preferredLocale, add a hop to the path while we switch
      // to the preferredLocale.
      return findCanonicalNodeWithPath(
        graph,
        node,
        preferredLocale,
        path.concat([{ node, locale }])
      )
    }
  }
docs: Given a starting node and the locale with which it was reached, this is a recursive function that will search the graph to find the canonical node(s).