Flatten nested join

            supabase
            .from('playground')
            .select(`
                photos:playground_photos(
                    photo(*)
                ),
            `).eq('id', playgroundId)
            .single()

This request returns a data object with the following structure:
{
  photos: [
    {
      photo: {...}
    },
    {
      photo: {...}
    }
  ]
}

Is this possible to flatten that like so:
{
  photos: [
    {
      ...
    },
    {
      ...
    }
  ]
}

So that I don't get an extra photo property? Without doing a for loop but directly in the query string of the select?
Was this page helpful?