graphql-schema
Schema design, federation, and resolution strategies.
npx skills add majiayu000/claude-skill-registry --skill architecture-andreibesleaga-gabbe-2 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# graphql-schema Skill This skill prevents "Graph Spaghetti" and ensuring performant Graph APIs. ## 1. Schema Design - **Consumption-First**: Design for the UI needs, not the DB schema. - **Naming**: `User.posts` (Good), `User.getPosts` (Bad - it's a field, not a method). - **Nullability**: - Default to **Nullable** for fields (resilience: if one field fails, partial data returns). - Use **Non-Null (!)** only for IDs and essential arguments. ## 2. N+1 Problem (The Graph Killer) - **Scenario**: Querying `users { posts { comments } }`. - **Solution**: **DataLoader** pattern. - Batches IDs from multiple resolvers. - Runs *one* DB query: `SELECT * FROM posts WHERE user_id IN (1, 2, 3)`. - Distributes results back to resolvers. ## 3. Pagination - Avoid `offset`/`limit`. - Use **Relay Connection Specification** (Cursor-based): ```graphql users(first: 10, after: "cursor") { edges { node { name } cursor } pageInfo { hasNextPage } } ``` ## 4. Security - **Depth Limiting**: Block queries deeper than 5 levels (prevent cyclic recursion DoS). - **Cost Analysis**: Assign points to fields. Block query if Cost > 1000. - **Introspection**: Disable in Production. ## 5. Federation (Apollo) - Use when
- 1. Schema Design
- 2. N+1 Problem (The Graph Killer)
- 3. Pagination
- 4. Security
- 5. Federation (Apollo)
What does the graphql-schema skill do?
Schema design, federation, and resolution strategies.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill architecture-andreibesleaga-gabbe-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
