Inspect dangling refs
inspect_dangling_refsAudit a serialized Apollo Cache to identify dangling __refs, unreachable entities, and objects Apollo could not normalize, enabling repair planning.
Instructions
Audit a serialized Apollo InMemoryCache (cache.extract() output) for dangling __refs, unreachable entities, and objects Apollo could not normalize. Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cache | Yes | The full serialized cache, exactly as returned by `cache.extract()`. Keys are cache IDs (e.g. "ROOT_QUERY", "User:1"); values are that entity's stored fields, which may contain `{ "__ref": "<cache id>" }` pointers to other entries in this same object. | |
| rootIds | No | Cache IDs to treat as reachability roots for the UNREACHABLE_ENTITY check, e.g. ["ROOT_QUERY"]. Omit to use every one of ROOT_QUERY / ROOT_MUTATION / ROOT_SUBSCRIPTION that is present in `cache`. Has no effect on ORPHANED_REF or normalization-gap findings. | |
| includeUnreachable | No | Include UNREACHABLE_ENTITY findings for entities no root can reach (candidates `cache.gc()` would collect). Set false to skip reachability analysis and only check refs/normalization. | |
| includeNormalizationGaps | No | Include MISSING_TYPENAME / MISSING_ID findings for inline (non-entity) objects that Apollo could not normalize because they lack a `__typename` or an `id`/`_id` field. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stats | Yes | Aggregate counts over the whole cache, independent of the findings list. | |
| findings | Yes | Every defect found, in walk order. |