3 ms·
The issue I have with just having a toObject or to_json method is that context is everything when serialising. Different access levels, different client types,
by jon-wood 10y ago
The issue I have with just having a toObject or to_json method is that context is everything when serialising. Different access levels, different client types, and just different parts of an API call for different ways of sending data to end users.
- keithwhor 10y agoWhich is why you very clearly specify the interface whenever .toObject is called (which fields are exposed). By default, everything is included, but you have complete granular control. It's what allows us to do things like have full GraphQL support. :) http://graphql.nodaljs.com/ http://graphql.nodaljs.com/