> Graphify: shared context of codebase for agents and developers. Canonical: https://graphify.com/blog/trace-api-across-frontend-and-backend · Full index: https://graphify.com/llms-full.txt

# Trace one API across a frontend and backend repo

*November 25, 2026 · Syed Fahad*

Trace one API across a frontend and backend repo by joining their graphs. When the client and the server live in different repositories, a single-repo graph cannot show both sides. `graphify merge-graphs` joins the two graphs so you can query them together.

This walkthrough uses the Graphify CLI on public checkouts of [pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) at commit `7f2773e` and [pocketbase/js-sdk](https://github.com/pocketbase/js-sdk) at commit `b190b36` (both 26 October 2026). PocketBase is the backend and official admin UI. The JS SDK is the TypeScript client. The broader multi-repo question is covered in [how to query a multi-repo code graph](https://graphify.com/blog/multi-repo-code-graph).

## How do I trace one API across a frontend and backend repo?

Build a code graph in each repository with `graphify update .`, merge the two graph.json files with `graphify merge-graphs`, and query the merged graph for the shared API name. The CLI will list matching nodes in both repositories and ask you to pick one.

```bash
uv tool install --python 3.12 graphifyy

git clone https://github.com/pocketbase/pocketbase.git
cd pocketbase && git checkout 7f2773e && graphify update . && cd ..

git clone https://github.com/pocketbase/js-sdk.git pocketbase-js-sdk
cd pocketbase-js-sdk && git checkout b190b36 && graphify update . && cd ..

graphify merge-graphs \
  pocketbase/graphify-out/graph.json \
  pocketbase-js-sdk/graphify-out/graph.json \
  --out merged-graph.json
```

On these checkouts the backend build read 683 files and finished in about 33 seconds, with 9,213 nodes, 44,110 edges and 420 communities. The JS SDK build read 52 files and finished in about 1 second, with 480 nodes, 1,069 edges and 15 communities. The merge finished in about a second and wrote 9,693 nodes and 45,179 edges. Results vary by codebase.

## What does graphify merge-graphs do?

It joins two or more graph.json files into one graph, tagging each node with the repository it came from. When the CLI can prove that two types are the same, it adds a same_type_as edge. When it cannot, you still get one map you can query by name.

On this pair the merged totals were the exact sum of the inputs: 9,213 plus 480 nodes, 44,110 plus 1,069 edges, and no `same_type_as` links. The merge did not invent a cross-repo call from the SDK method to the Go handler. What it did give us is a single graph whose nodes are tagged `pocketbase` or `pocketbase-js-sdk`, which is enough to search both sides at once.

## Which name should I search for first?

Start with the response type or the client method that both repositories share, such as RecordAuthResponse. If the name is ambiguous, pick the node in the client repo and the node in the server repo and open both files.

`RecordAuthResponse` is the type returned when a PocketBase client authenticates a record. On the merged graph the name was ambiguous in a useful way:

```text
graphify affected "RecordAuthResponse" --graph merged-graph.json
Ambiguous: 'RecordAuthResponse' matches 3 nodes in different files.
  pocketbase/plugins/jsvm/internal/types/generated/types.d.ts
  pocketbase/apis/record_helpers.go
  pocketbase-js-sdk/src/services/RecordService.ts
Retry with path::symbol using one of the paths above
```

Those three files are the review set. `RecordService.ts` is the client type. `record_helpers.go` is the server helper that builds the response. The generated `types.d.ts` is the copy inside the backend's JSVM plugin. Open the client and the server together, and check that the fields you are about to change still agree.

The JS SDK method that returns that response is `.authWithPassword()` in `src/services/RecordService.ts`. The backend repository also has an admin UI call of the same name in `ui/src/auth/pageSuperuserLogin.js`. Those are the two call sites you want in view if you change the password-auth contract.

## Will every frontend and backend pair get cross-repo edges?

No. On the PocketBase plus JS SDK pair used here, the merged graph had exactly the sum of the input nodes and edges, and no same_type_as links. The value was a single query that returned the name in both repositories.

That is a real limit, and it is worth stating. `merge-graphs` can add `same_type_as` edges when two repositories declare the same fully qualified type, and it can bind some cross-repo member calls when the type and method line up. This pair did not give the CLI enough to do that. You still save the work of keeping two graphs and two queries in your head.

The same "pick the node" habit from the language tutorials applies here: see [find every caller before a refactor in TypeScript](https://graphify.com/blog/find-typescript-callers-before-a-refactor) and [find every caller before a refactor in Java](https://graphify.com/blog/find-java-callers-before-a-refactor). After either repository changes, rebuild that graph and merge again. The [install guide](https://graphify.com/blog/install-graphify) covers setup, and the hosted app is at [app.graphify.com](https://app.graphify.com).
