# How do you deal with large, deeply nested objects in Mirage?

**URL:** <https://discuss.emberjs.com/t/how-do-you-deal-with-large-deeply-nested-objects-in-mirage/15529>\
**Category:** Ember Data\
**Created:** [September 22, 2018, 4:32am UTC](https://discuss.emberjs.com/t/how-do-you-deal-with-large-deeply-nested-objects-in-mirage/15529 "2018-09-22T04:32:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![GregWeb](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/gregweb/32/13583_2.png) [@GregWeb](https://discuss.emberjs.com/u/GregWeb)\
**Post date:** [September 22, 2018, 4:32am UTC](https://discuss.emberjs.com/t/how-do-you-deal-with-large-deeply-nested-objects-in-mirage/15529/1 "2018-09-22T04:32:56Z")

</div>

Every example I’ve seen for mirage (and I just spent half an hour clicking through every repo I found using Mirage) uses a simple flat structure their factories…

But I have an `account` factory that looks like this:

```auto
//factories/account.js

account {
  /*..dozens 
  of other 
  key values
  ...
  */
  settings: {..},

  integrations: {
    googleAnalytics: {..}
    webhooks: {
      state: {
        url: "example.com"
        status: "active"
      }
    }
  }
}

```

When I fill out webhook info and submit I just need the updated webhook values to be returned from the post route.

How do I achieve this?

---

<div class="post-metadata">

**Author:** ![dknutsen](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/dknutsen/32/16471_2.png) [@dknutsen](https://discuss.emberjs.com/u/dknutsen)\
**Post date:** [September 25, 2018, 2:15am UTC](https://discuss.emberjs.com/t/how-do-you-deal-with-large-deeply-nested-objects-in-mirage/15529/2 "2018-09-25T02:15:32Z")

</div>

You’ll need to use a [custom route handler](http://www.ember-cli-mirage.com/docs/v0.4.x/route-handlers/#function-handler). The exact implementation will depend on your mirage model (whether it’s a special mirage model or the autodetected ember data model) if it uses a model at all. You can customize pretty much anything about how the payload is parsed and how the response is returned.
