runFnForEachNodeQuery = async fn => {
  const nodeQueries = getContentTypeQueryInfos()

  const chunkSize = getPluginOptions()?.schema?.requestConcurrency || 15
  const chunkedQueries = chunk(nodeQueries, chunkSize)

  for (const queries of chunkedQueries) {
    await Promise.all(
      queries.map(async queryInfo => {
        if (
          // if the type settings call for lazyNodes, don't fetch them upfront here
          (queryInfo.settings.lazyNodes &&
            // but not in Gatsby v4+ since lazyNodes isn't supported in 4+
            !usingGatsbyV4OrGreater) ||
          // for media items we only want to fetch referenced nodes so don't fetch them here.
          queryInfo.typeInfo.nodesTypeName === `MediaItem`
        ) {
          return
        }

        await fn({ queryInfo })
      })
    )
  }
}
fetchWPGQLContentNodesByContentType

fetches nodes from the remote WPGQL server and groups them by post type

@returns {Array}