Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

relay-performance

Skill by meta

Relay Performance gives performance best practices for Relay applications. It covers query placement, @defer, pagination, fetch policies, garbage collection, fragment granularity, and server-side filtering.

  • Score 88
  • 19k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install relay-performance

Built from the published package, never by AI.

git clone --depth 1 https://github.com/meta/relay /tmp/relay && mkdir -p ~/.claude/skills && cp -r /tmp/relay/skills/relay-performance ~/.claude/skills/relay-performance

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install relay-performance in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

relay-performance is an agent skill that gives performance best practices for Relay applications. It covers query placement, @defer, pagination, fetch policies, garbage collection, fragment granularity, and server-side filtering. Guidance includes one root query per screen, preloading the initial query before rendering the root, and filtering and sorting on the server.

Each practice is shown with GraphQL and TSX examples that compare good and bad patterns. The skill points to Relay's llm-docs for detailed API documentation and is a companion to the relay-best-practices skill, which covers correctness and architecture. It suits developers who want to optimize data fetching, reduce re-renders, or improve time to first meaningful paint in Relay apps.

Written from the project's SKILL.md and checked against it.

What it can do

  • One query per screenKeeps each route to one or very few root queries so Relay coalesces data into a single request.
  • Preload before renderStarts the initial query with loadQuery before calling createRoot().render().
  • @deferDefers secondary or below-the-fold content so the primary UI renders sooner.
  • Fetch policiesExplains store-or-network, store-and-network, network-only and store-only and when to use each.
  • Garbage collectionShows how to set gcReleaseBufferSize to keep recently used queries in the store.
  • PaginationPaginates list fields with @connection and usePaginationFragment instead of fetching unbounded collections.
  • Fragment granularitySplits large fragments so only the components whose data changed re-render.
  • Server-side filteringUses GraphQL field arguments to filter and sort data on the server instead of on the client.

What you need

  • Relay v20.1.1 or later, for the bundled llm-docs
  • relay-best-practices skill, as the companion for correctness and architecture

Try asking

  • Review my Relay screen and tell me if it makes more than one root query.
  • Show me how to defer the sidebar and comments in my ProfileScreen query.
  • Change my TaskList fragment to filter active tasks on the server.

Good to know

  • Covers performance only. Correctness, naming and architecture are in the relay-best-practices skill.
  • Detailed API documentation is read from llm-docs and is not included in the skill itself.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/relay-performance/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md9 KB

Alternatives to relay-performance

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

relay-performance: common questions

What does relay-performance cover?

It covers query placement, @defer, pagination, fetch policies, garbage collection, fragment granularity, and server-side filtering in Relay applications.

How does relay-performance relate to relay-best-practices?

The source describes relay-performance as a companion to relay-best-practices, which covers correctness and architecture while this skill covers performance.

When should network-only fetch policy be used in Relay?

The source says to reserve network-only for rare cases, such as when freshness is critical, for example after a mutation with wide side effects.

How do I install relay-performance?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is relay-performance free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is relay-performance safe to use?

It scores 88 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to relay-performance?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

relay-performance Install

Add to stack

Loading.