Skip to main content
Angular Query DevTools help you visualize all of the inner workings of TanStack Query and provide a better debugging experience. DevTools display active, inactive, and stale queries, along with their data and cache status.

Installation

The DevTools are included as an optional peer dependency. Install them separately:
The devtools package is listed as an optionalDependency in Angular Query, so you may see warnings during installation if you skip it. This is normal.

Basic Setup

The easiest way to use DevTools is with withDevtools(), which automatically displays them in development mode:
main.ts

Configuration Options

Customize DevTools behavior by passing options to withDevtools():
main.ts

Available Options

boolean
default:"false"
If true, the DevTools panel will be open by default when the page loads.
'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
default:"'bottom-right'"
Position of the floating DevTools toggle button.
'top' | 'bottom' | 'left' | 'right'
default:"'bottom'"
Side of the screen where the DevTools panel appears.
boolean
default:"isDevMode()"
Controls whether DevTools should load. By default, only loads in development mode.
QueryClient
Optionally specify a different QueryClient. By default, uses the injected QueryClient.
ErrorType[]
Configure error types for error filtering in DevTools.

Reactive Configuration

You can make DevTools options reactive by reading signals or other dependencies:
main.ts

Advanced: DevTools Panel

For more control, use injectDevtoolsPanel to manually render DevTools in your own component:
devtools.component.ts

DevTools Panel Options

ElementRef
required
The DOM element where DevTools will be rendered.
QueryClient
The QueryClient instance to monitor. Defaults to the injected client.
ErrorType[]
Error types for filtering.
string
CSP nonce for inline styles.
ShadowRoot
Render DevTools in a Shadow DOM.
() => void
Callback when DevTools panel is closed.

Using in Your Own DevTools

You can embed TanStack Query DevTools inside your own custom DevTools UI:
custom-devtools.component.ts

Forcing Production Build

If you need to load DevTools in production (not recommended), import from the production entry point:
main.ts
Loading DevTools in production adds ~40KB to your bundle. Only do this for internal tools or staging environments.

DevTools Features

Once DevTools are open, you can:

Query List

  • View all queries with their keys, status, and timestamps
  • Filter queries by status (fresh, fetching, stale, inactive)
  • Search queries by key
  • See query dependencies and relationships

Query Details

Click a query to see:
  • Data: The current cached data (formatted JSON)
  • Query Info: Status, timestamps, fetch count, error count
  • Observers: Number of components watching this query
  • Actions: Manually refetch, invalidate, or remove the query

Mutation Tracking

  • View active and recent mutations
  • See mutation status and variables
  • Track mutation history

Cache Management

  • View total cache size
  • See garbage collection status
  • Manually clear the entire cache

Troubleshooting

DevTools Not Appearing

DevTools Panel Is Empty

If the DevTools panel opens but shows no queries:
  1. Ensure you’ve created at least one query using injectQuery
  2. Check that the correct QueryClient is being used
  3. Try triggering a query manually to see if it appears

Performance Issues

If DevTools slow down your application:
  1. Close DevTools when not actively debugging
  2. Consider using injectDevtoolsPanel to render in a separate window
  3. Reduce the number of queries or use query cancellation

Best Practices

Leave DevTools enabled during development for the best debugging experience. They’re automatically excluded from production builds.
  1. Use Descriptive Query Keys: Makes it easier to find queries in DevTools
  2. Monitor Cache Size: Use DevTools to identify queries that cache too much data
  3. Track Refetch Patterns: Watch for queries that refetch too frequently
  4. Debug Stale Data: Use DevTools to understand when queries become stale
  5. Test Error States: Use DevTools actions to trigger refetches and test error handling

Next Steps

Queries Guide

Learn advanced query patterns

Testing

Test your queries effectively

SSR

Server-side rendering with Angular Query

API Reference

Complete DevTools API