sample data from getquery graphql generated api
{
    id: '',
    name: '',
    regions: [
      {
        id: '',
        name: '',
        districts: [
          {
            id: '',
            name: '',
            locations: [{ id: '', city: '', division: '', street: '' }],
          },
        ],
      },
    ],
  }
convert it to
{
  id: '',
  name: '',
  regions: {
    id: '',
    name: '',
    districts: {
      id: '',
      name: '',
      locations: { id: '', city: '', division: '', street: '' },
    },
  },
}
I already tried to convert it by using this code
const data = dataGetOrganization?.AllCountries
const result = Object.keys(data).reduce((acc, key) => {
  acc[key] = {
    ...data[key],
    _styles: {
      root: { overflow: 'hidden' },
    },
  }
  return acc
})
 
     
    