Get Linked Document from a Slice in a Custom Type [Unable to find body in homepage]

OK, so here is how my colleague maintains 2 queries:

  1. One standard REST API query for all the content
  2. A query only for the linked content

and then incorporates Slices and linked data into the classic array of slices:
https://github1s.com/chamois-d-or/cimsirp/blob/main/pages/index.js

  //Incorporating new slices with linked product data in existing slice array
  let index=0
  const docWithProductLists = {
    ...document,
    data : {
      ...document.data,
      slices: document?.data?.slices?.map(slice => {
        if(slice.slice_type === "product_list_with_cta"){
          index ++
          return {
            ...productListData?.data?.slices[index-1]
          }
        }
        return {
          ...slice
        }
      })
    }
  }


Hopefully, this should make querying and maintaining linked content simpler.