How to do a nuxt-content fetch join (or deep fetch)?

155 Views Asked by At

I have multiple json5 files that I need to join. Like in MySQL but with nuxt-content for a static stite with no SSR. I have done something but it doesn't work when I do nuxt generate

Ex:

data.json5
{ 
  title: 'title'
  date: date,
  cars: ['honda-2019', 'audi-2020'] // array of car slug
}

honda-2019.json5
{
  title: 'Honda 2019'
  year: '2019',
  parts: ['motor', 'wheels']
}

motor.json5
{
  title: 'motor'
  working: true
}

Final object

{ 
  title: 'title'
  date: date,
  cars: [
   {
      title: 'Honda 2019'
      year: '2019',
      parts: [{...}, {...}]
    },
    { ... }
  ]
}
0

There are 0 best solutions below