Skip to content

Commit 9e3a973

Browse files
committed
chore: comment describing when relation fields are skipped
1 parent b0c6a5b commit 9e3a973

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

request.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node)
498498
continue
499499
}
500500

501+
// If the field is also a polyrelation field, then prefer the polyrelation.
502+
// Otherwise stop processing this node.
503+
// This is to allow relation and polyrelation fields to coexist, supporting deprecation for consumers
501504
if pFieldType, ok := polyrelationFields[args[1]]; ok && fieldValue.Type() != pFieldType {
502505
continue
503506
}

0 commit comments

Comments
 (0)