Skip to content

[Bug]: TypeScript object type aliases lose method signatures in the graph #5455

Done

Description

@rvitaliy

Pre-flight checks

  • I have checked the Troubleshooting section in the README.

What happened?

Graphify extracts a method edge and a .read() node for a method signature in a TypeScript interface. It keeps the type nodes for equivalent named object type aliases but drops their method signatures. This affects both plain object aliases and aliases wrapped in Readonly.

I expected each of the three named types below to have its own method edge to its read() declaration, with source provenance on the declaration.

Steps to reproduce

In an empty directory, save this as ports.ts:

interface InterfacePort { read(): number }
type AliasPort = { read(): number };
type ReadonlyPort = Readonly<{ read(): number }>;

Run the code-only extractor:

uv run --no-project --python 3.14 --with graphifyy==0.9.118 graphify extract . --code-only

Inspect graphify-out/graph.json with this command:

uv run --no-project --python 3.14 python - <<'PY'
import json
from pathlib import Path

graph = json.loads(Path("graphify-out/graph.json").read_text())
labels = {node["id"]: node["label"] for node in graph["nodes"]}
for edge in graph["links"]:
    if edge.get("relation") == "method":
        print(labels[edge["source"]], "->", labels[edge["target"]])
PY

Graph output

InterfacePort -> .read()

AliasPort and ReadonlyPort are both present in nodes, with no outgoing method edge. The expected output includes AliasPort -> .read() and ReadonlyPort -> .read() as well.

Environment

  • Graphify 0.9.118
  • macOS ARM64, Python 3.14.10
  • Isolated uv run from PyPI, using code-only extraction

The missing declarations make it harder to navigate contract methods in TypeScript projects that use structural aliases for their application ports. This report is about extracting the declared signatures and their parent edges. #3961 is related and covers signatures in abstract classes.

Activity

  1. github-actions commented on Nov 24, 2026

    @github-actions

    Thanks for opening this issue, @rvitaliy. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  2. rvitaliy commented on Nov 26, 2026

    @rvitaliy
    ContributorAuthor

    Shipped in v0.9.121: #5456 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions