analyze-overfetch

Inventory GraphQL queries and fragments, trace field usage, and generate audit-ready optimization plans.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/steltz/skill-factory --skill analyze-overfetch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: analyze-overfetch
Source: https://github.com/steltz/skill-factory/tree/main/plugins/graphql-overfetch-analyzer/skills/analyze-overfetch
Command: npx skills add https://github.com/steltz/skill-factory --skill analyze-overfetch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identify and analyze GraphQL queries and fragments that fetch more data than the application consumes.

Core Features & Use Cases

  • Inventory GraphQL artifacts (queries and fragments) across the codebase
  • Trace how fetched fields are used in consumers and auditors
  • Recommend safe removals and/or per-consumer query splits to minimize data transfer
  • Use case: optimize a large client app by removing unused fields from common queries and fragments
  • Use case: prepare a migration plan when refactoring APIs that introduce extra fields

Quick Start

Run the analyze-overfetch skill on your repository to inventory GraphQL queries, trace field usage, and generate an audit-ready report.

Frequently Asked Questions about analyze-overfetch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify unused fields in GraphQL queries?

To identify unused fields in GraphQL queries, you inventory queries and fragments across the codebase, trace how fetched fields are consumed by client-side components, and generate a catalog of over-fetched data. This reveals fields safe for removal.

What is GraphQL over-fetching and how do I audit it?

GraphQL over-fetching occurs when queries retrieve more data than the application consumes. Auditing involves inventorying artifacts, tracing field usage in consumers, and generating an audit-ready plan with recommendations for safe removals or per-consumer query splits.

How do I optimize shared GraphQL fragments in a large codebase?

Optimizing shared GraphQL fragments in a large codebase requires tracing field usage across multiple routes and consumers. The process inventories artifacts and generates trace reports to inform safe removals and per-consumer query splits, minimizing data transfer.

Can I use an overfetch audit to prepare a GraphQL API migration plan?

Yes, you can prepare a migration plan when refactoring APIs that introduce extra fields. The audit generates trace reports of field usage and outputs an audit-ready plan for safe optimizations, ensuring unused fields are removed before migration.

What is the best way to split GraphQL queries for per-consumer usage?

The best way to split GraphQL queries for per-consumer usage is to generate a catalog of fetched fields and trace their actual usage. This analysis informs safe per-consumer query splits, removing unused fields from common queries and fragments.

Does this overfetch analysis work with client-side GraphQL usage?

Yes, this overfetch analysis is designed for large codebases with client-side GraphQL usage. It inventories queries and fragments, traces field usage across multiple routes, and outputs an audit-ready plan for safe optimizations.