function createPathTransformer () {
  return new TypeTransformer({
    signature: PATH,
    isTypeInstance: object => object instanceof Path,
    toStructure: object => {
      throw newError(
        `It is not allowed to pass paths in query parameters, given: ${object}`,
        PROTOCOL_ERROR
      )
    },
    fromStructure: struct => {
      structure.verifyStructSize('Path', PATH_STRUCT_SIZE, struct.size)

      const [nodes, rels, sequence] = struct.fields

      const segments = []
      let prevNode = nodes[0]

      for (let i = 0; i < sequence.length; i += 2) {
        const nextNode = nodes[sequence[i + 1]]
        const relIndex = toNumber(sequence[i])
        let rel

        if (relIndex > 0) {
          rel = rels[relIndex - 1]
          if (rel instanceof UnboundRelationship) {
            // To avoid duplication, relationships in a path do not contain
            // information about their start and end nodes, that's instead
            // inferred from the path sequence. This is us inferring (and,
            // for performance reasons remembering) the start/end of a rel.
            rels[relIndex - 1] = rel = rel.bindTo(
              prevNode,
              nextNode
            )
          }
        } else {
          rel = rels[-relIndex - 1]
          if (rel instanceof UnboundRelationship) {
            // See above
            rels[-relIndex - 1] = rel = rel.bindTo(
              nextNode,
              prevNode
            )
          }
        }
        // Done hydrating one path segment.
        segments.push(new PathSegment(prevNode, rel, nextNode))
        prevNode = nextNode
      }
      return new Path(nodes[0], nodes[nodes.length - 1], segments)
    }
  })
}
Creates the Path Transformer
@returns {TypeTransformer}