ChromaticHQ / jsonmonger

23 stars 1 forks source link

Provide fetch() settings for fetching related records #3

Closed agarzola closed 6 years ago

agarzola commented 6 years ago

It would be useful to allow a configuration object to be passed to .fetch() to indicate whether to opt-in to/-out of including related records in the json:api response. I see this as having one of two options:

Additionally, an option to only include the attributes mapped in the model properties would be useful to cut down on server response size.

In both cases, it would be superb to set these options on a per-Model or even global manner with a fallback behavior that puts the closest indication first (.fetch() param first, then Model options, then global config). Pending #1, of course.