In Turborepo 2.2, we're introducing turbo query—a new command that allows running GraphQL queries against Turborepo's repository data. Tur

Turborepo 2.2

submited by
Style Pass
2024-10-18 21:30:04

In Turborepo 2.2, we're introducing turbo query—a new command that allows running GraphQL queries against Turborepo's repository data. Turborepo computes lots of data about your repository in order to execute your tasks with maximum efficiency. This includes your package dependency graph, changed packages, task dependencies, log output from your tasks, and more. This data can be useful for scripting, refactoring, determine what to run in CI, and discovering other insights into your codebase.

To get started, run turbo query to open GraphiQL—a local IDE for writing GraphQL queries that supports interactive schema exploration, documentation, and sending queries.

Turborepo has added APIs for structured data in the past, such as run summaries, dry run, and ls. However, these APIs have some limitations. First, they're centered around a single run, not general repository info. Second, as we added more fields, the output quickly became very large. We needed a way to query repository data in a run-agnostic fashion, and make the returned data more customizable.

Caching tasks is one of the most powerful features of Turborepo, speeding up builds and other tasks by only re-running what has changed. With Turborepo 2.2, we're releasing some improvements to help configure cache inputs and outputs, and warn you when things don't look quite correct.

Leave a Comment