reachableIds function
Returns a set of dataIds that can be reached by any root query.
Implementation
Set<String> reachableIds(
Map<String, dynamic>? Function(String dataId) read, [
Map<String, TypePolicy> typePolicies = const {},
String referenceKey = kDefaultReferenceKey,
]) =>
defaultRootTypenames.keys
.map(
(type) => typenameForOperationType(
type,
typePolicies,
),
)
.fold(
{},
(ids, rootTypename) => ids
..add(rootTypename)
..addAll(
_idsInObject(
read(rootTypename),
read,
referenceKey,
{},
),
),
);