function pathStrToObj(path) {
  let pathObj = { path, type: 'value', isQuery: false }
  const queryId = getQueryIdFromPath(path)
  // If Query id exists split params from path
  if (queryId) {
    const pathArray = path.split('#')
    pathObj = Object.assign({}, pathObj, {
      queryId,
      isQuery: true,
      path: pathArray[0],
      queryParams: pathArray[1].split('&')
    })
    if (getPopulates(pathArray[1].split('&'))) {
      pathObj.populates = getPopulates(pathArray[1].split('&'))
      pathObj.queryParams = remove(
        pathArray[1].split('&'),
        (p) => p.indexOf('populate') === -1
      )
    }
  }
  // if queryId does not exist, return original pathObj
  return pathObj
}
@description Convert path string to object with queryParams, path, and populates
@param {string} path - Path that can contain query parameters and populates
@returns {object} watchEvents - Array of watch events