Skip to content

Commit

Permalink
chore: comment describing when relation fields are skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
notchairmk committed Jan 7, 2025
1 parent b0c6a5b commit 9e3a973
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,9 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node)
continue
}

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

0 comments on commit 9e3a973

Please sign in to comment.