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
This is more of a feature request than a bug, and is the only thing preventing Groot from doing exactly what my App needs. As it stands all relationships are treated as complete/perfect relationships, which is not always the case.
Feature:
Be able to set an annotation on a relationship that flags it to not override existing relationships but instead merge them.
For example, my situation requires that certain objects be attached to the current logged in User object. These objects may already be attached to another User and as such need to retain that relationship post mapping.
I have been trying to work on my own fork to get this to work, and so far have had no success.
The text was updated successfully, but these errors were encountered:
Not sure I understand you, but I handled with a similar issue (I think) a few days ago.
I had a Entity User which has some attributes. In the responses from my api, I had an array of attributes which were different for each request, but they all belonged to the user so I didn't want them to replace the existing ones.
Finally I solved it by adding a custom accessor for my attributes relationship:
extensionUser{publicvarattributes:Set<Attribute>?{get{self.willAccessValue(forKey: #keyPath(User.attributes))letattributes=self.primitiveValue(forKey: #keyPath(User.attributes))as?Set<Attribute>self.didAccessValue(forKey: #keyPath(User.attributes))return attributes
}set{varset=Set<Attribute>()
for attr in (attributes ??[]){
set.insert(attr)}
for attr in (newValue ??[]){
set.insert(attr)}self.willChangeValue(forKey: #keyPath(User.attributes))self.setPrimitiveValue(set, forKey: #keyPath(User.attributes))self.didChangeValue(forKey: #keyPath(User.attributes))}}}
Again, not sure if this is the problem you have, but maybe it could help.
This is more of a feature request than a bug, and is the only thing preventing Groot from doing exactly what my App needs. As it stands all relationships are treated as complete/perfect relationships, which is not always the case.
Feature:
Be able to set an annotation on a relationship that flags it to not override existing relationships but instead merge them.
For example, my situation requires that certain objects be attached to the current logged in User object. These objects may already be attached to another User and as such need to retain that relationship post mapping.
I have been trying to work on my own fork to get this to work, and so far have had no success.
The text was updated successfully, but these errors were encountered: