type_hierarchy
Fetch a Swift type's complete relationship map in one call: subclasses, conformers, extensions, and parent declarations. Provide the node ID to receive a labeled JSON with all graph connections.
Instructions
Return everything the graph knows about one Swift type's relationships.
Swift spreads a type across three relations that the sibling language modules do not have to separate, and answering "what is this type" means reading all three at once:
conformers — every type and extension conforming to it, if it is a protocol. This is the question about a protocol.
subclasses — every direct subclass, if it is a class or actor.
extensions — every
extensiondeclared on it, which in Swift routinely live in other files. "Where is the rest of this type" is a real question with a graph answer.conforms_to / inherits_from — what it declares for itself.
Calling callers() three times with three relations returns the same
facts; this returns them together, already labelled, because for a Swift
type they are one question.
:param node_id: Node ID of a class, struct, enum, protocol or actor, e.g.
proto:Sources/SampleKit/Storage.swift:Repository.
:return: JSON with node, conformers, subclasses, extensions,
conforms_to and inherits_from.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |