function reduceToTopmostApiCallsFromStrings(keyPathStrings) {
  // because we sort first, we never have to back track
  const allPaths = keyPathStrings.sort()
  return allPaths.filter((path) => {
    const parts = path.split('.')
    // only one part, safe to keep
    if (parts.length === 1) {
      return true
    }
    // 'x.y.z' has parents 'x' and 'x.y'
    const parentParts = parts.slice(0, -1)
    const parents = parentParts.map((_, index) =>
      parentParts.slice(0, index + 1).join('.')
    )
    // dont include this if a parent appears in the array
    const parentsAlreadyInArray = parents.some((parent) =>
      allPaths.includes(parent)
    )
    if (parentsAlreadyInArray) {
      return false
    }
    // if no parents found, ok to include
    return true
  })
}
If array contains 'x' and 'x.y' just keep 'x'

@param {string[]} keyPathStrings
@returns {string[]}