batchByCustomGrouping

suspend fun <T : NodeObject, C : SelectiveNodeExecutionContext<T>, K> batchByCustomGrouping(contexts: List<C>, groupBy: (SelectionSet<T>) -> K, resolve: suspend (Group<T, C, K>) -> Map<C, FieldValue<T>>): Map<C, FieldValue<T>>(source)

Partitions contexts by a tenant-defined key derived from each context's selection set.

Groups are visited in first-key input order, and each Group.contexts list retains input order. The resolve result may contain only keys that match contexts in the current group under normal map-key equality. Out-of-group keys are rejected.