You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today, these 2 classes have the same dehydrate method, which returns the document without the Associations attributes, and hydrates the document's relationships attribute with the relationships defined in the app's schema.
The default is that even if there are no relationships, the document has X(number of relationships defined in the app schema) objects added to its relationships attribute, and is registered in the DB as such.
It would probably be wiser not to add relationships that have no data?
Today, these 2 classes have the same
dehydrate
method, which returns the document without the Associations attributes, and hydrates the document'srelationships
attribute with the relationships defined in the app's schema.The default is that even if there are no relationships, the document has X(number of relationships defined in the app schema) objects added to its
relationships
attribute, and is registered in the DB as such.It would probably be wiser not to add relationships that have no data?
This was highlighted during a development on cozy-contacts, where we needed to dehydrate the document.
https://github.com/cozy/cozy-contacts/blob/131c50c17c66171ba6e7c0cc3997b88abac259b1/src/components/ContactCard/ContactForm/helpers.js#L174-L191
The text was updated successfully, but these errors were encountered: