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

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:

//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?

You’ll need to use a custom route 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.