Back to articles

Nx

nx graph — Reading Your Dependency Tree

Jun 2026

What running nx graph actually shows you about your monorepo, and why it's the fastest way to spot coupling and predict what nx affected will run.

One command changed how I understand our codebase:

npx nx graph

That's it. Open the browser, and the entire monorepo is laid out as an interactive dependency graph.

As a frontend dev, I used to mentally track which apps shared which libraries. After a while, that map only lives in your head — and it's always incomplete. The graph makes it explicit.

  • Every edge, visible. Every app, every shared library, every dependency — who imports what, and in which direction.
  • Blast radius, before you push. Change lib-ui? The graph immediately shows app-web and app-admin both depend on it, while app-mobile doesn't. CI only rebuilds what's actually connected.

Three things I read from it now:

  • Which apps will be affected, before I even push
  • Where coupling is growing — tightly connected nodes are refactor warnings
  • Why nx affected picks the tasks it does — it's just a graph traversal

There's also npx nx affected --graph — the same view, filtered to only what your current branch touches. It's the fastest architecture overview you'll get on a monorepo you've just joined.

nx graph — reading your monorepo's dependency tree