subfieldConflicts function
Given a series of Conflicts which occurred between two sub-fields, generate a single Conflict.
Implementation
Conflict? subfieldConflicts(
List<Conflict> conflicts,
String responseName,
FieldNode node1,
FieldNode node2,
) {
if (conflicts.isNotEmpty) {
return Conflict(
ConflictReason(
responseName,
conflicts.map((c) => c.reason).toList(),
null,
),
[node1, ...conflicts.expand((c) => c.fields1)],
[node2, ...conflicts.expand((c) => c.fields2)],
);
}
}