Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Design GraphQL schemas with federation, resolvers, dataloaders, n+1 query prevention, and schema stitching patterns
.claude/skills/williamzujkowski-graphql-schema-designer/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 35% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 6% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 69% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 513% | 0% |
Trigger conditions:
Not for:
Time normalization:
NOW_ET using NIST/time.gov semantics (America/New_York, ISO-8601): 2025-10-26T03:51:54-04:00NOW_ET for all citation access datesInput validation:
schema_type must be exactly: "standalone", "federated", or "stitched"use_case if provided must be one of: "api-gateway", "microservices", "mobile-bff"optimization_level must be: "basic" or "production"entities if provided must be valid array of objects with name, fields, relationshipsfederation_config required if schema_type is "federated"Source freshness:
Fast path for 80% of standalone GraphQL schema cases:
! based on business rulesgetUser, listUsers, createUser, updateUser, deleteUserlimit, offset argumentstotalCount for UI pagination controlstype UserResult = User | NotFoundError | ValidationErrorOutput: Basic GraphQL schema SDL with queries, mutations, and types
Token budget: ≤2k tokens (type definitions + basic resolvers)
Extended implementation with n+1 prevention and federation:
new DataLoader(batchLoadFn)SELECT * FROM users WHERE id IN (?)javascript { User: { posts: (parent, args, { dataloaders }) => dataloaders.postsByUserId.load(parent.id) } }
first, after, last, before argumentshasNextPage, hasPreviousPage in pageInfo@key directive: type User @key(fields: "id") { id: ID! }__resolveReference(reference)@shareable for common types across subgraphs@external and @requires for field dependencies@auth directive for field-level security@auth(requires: ADMIN)Output: Production-ready schema with federation, DataLoaders, pagination, and security
Token budget: ≤6k tokens (T1 + optimization patterns + federation setup)
Deep dive with schema stitching, subscriptions, and advanced optimization:
pubsub.publish('USER_UPDATED', payload)graphql type Subscription { userUpdated(userId: ID!): User newOrder: Order @auth(requires: ADMIN) }
@override for gradual service migrationfield: String @deprecated(reason: "Use newField")Output: Complete enterprise-grade GraphQL architecture with subscriptions, stitching, and monitoring
Token budget: ≤12k tokens (T2 + subscriptions + stitching + advanced patterns)
When to use standalone vs. federated:
When to use schema stitching vs. federation:
n+1 detection triggers:
Pagination strategy selection:
Stop conditions:
entities is empty and no existing schema: ERROR "Cannot generate schema without entity definitions"federation_config missing for federated type: ERROR "Federation config required for federated schema"Required fields:
yamlschema_definition: | # GraphQL SDL string with complete schema type Query { ... } type Mutation { ... } type User { ... } resolver_patterns: dataloader_setup: "Code pattern for DataLoader initialization" batch_loading: "Batch loading function examples" error_handling: "Error handling middleware pattern" optimization_config: dataloader_enabled: boolean query_complexity_limit: integer depth_limit: integer pagination_type: "offset | cursor" caching_strategy: "per-request | redis | none"
Additional fields for federated:
yamlfederation_config: version: "v2" subgraph_name: string entities: array shared_types: array directives_used: ["@key", "@shareable", "@external"]
Security directives (if production optimization):
yamlsecurity_directives: - name: "@auth" description: "Field-level authorization" locations: ["FIELD_DEFINITION", "OBJECT"] - name: "@rateLimit" description: "Rate limiting per field" locations: ["FIELD_DEFINITION"]
Type definitions:
schema_definition: string (GraphQL SDL)resolver_patterns: object with code snippetsoptimization_config: object with configuration valuesfederation_config: object (only if schema_type is "federated")security_directives: array of directive definitionsExample: Federated User Service Schema (≤30 lines)
graphqlextend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable"]) type User @key(fields: "id") { id: ID! email: String! posts: [Post!]! # Resolved via DataLoader } type Post @key(fields: "id") { id: ID! title: String! authorId: ID! @external } type Query { user(id: ID!): User users(first: Int, after: String): UserConnection! } type UserConnection { edges: [UserEdge!]! pageInfo: PageInfo! } scalar DateTime
Token budgets (enforced):
Schema validation:
Federation validation (if federated):
Performance checks:
Security gates:
Determinism:
Auditability:
GraphQL Specification & Best Practices:
Apollo Federation:
DataLoader & Optimization:
Schema Stitching:
Authentication & Authorization:
Subscriptions:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 16,723 | 10,073 | -40% | 1 | 1 | 0% | 4,300 | 6,284 | +46% | 0 | 0 | — |
case-12 | pass→fail | 12,607 | 9,164 | -27% | 1 | 1 | 0% | 2,650 | 5,678 | +114% | 0 | 0 | — |
case-02 | fail→pass | 16,234 | 7,574 | -53% | 1 | 1 | 0% | 4,122 | 5,571 | +35% | 0 | 0 | — |
case-03 | fail→pass | 22,234 | 9,967 | -55% | 1 | 1 | 0% | 5,744 | 6,099 | +6% | 0 | 0 | — |
case-04 | pass→pass | 10,428 | 7,884 | -24% | 1 | 1 | 0% | 2,362 | 5,420 | +129% | 0 | 0 | — |
case-05 | pass→pass | 12,348 | 9,992 | -19% | 1 | 1 | 0% | 2,818 | 5,625 | +100% | 0 | 0 | — |
case-06 | pass→pass | 7,686 | 9,993 | +30% | 1 | 1 | 0% | 1,820 | 5,743 | +216% | 0 | 0 | — |
case-13 | pass→pass | 13,447 | 7,720 | -43% | 1 | 1 | 0% | 2,820 | 5,169 | +83% | 0 | 0 | — |
case-07 | pass→pass | 18,838 | 13,010 | -31% | 1 | 1 | 0% | 4,017 | 6,556 | +63% | 0 | 0 | — |
case-08 | pass→pass | 11,266 | 6,008 | -47% | 1 | 1 | 0% | 2,508 | 4,896 | +95% | 0 | 0 | — |
case-09 | fail→fail | 14,139 | 8,821 | -38% | 1 | 1 | 0% | 3,096 | 5,638 | +82% | 0 | 0 | — |
case-10 | fail→pass | 16,554 | 9,450 | -43% | 1 | 1 | 0% | 3,300 | 5,567 | +69% | 0 | 0 | — |
case-11 | fail→fail | 8,529 | 7,141 | -16% | 1 | 1 | 0% | 1,625 | 4,780 | +194% | 0 | 0 | — |
case-14 | pass→pass | 7,881 | 5,655 | -28% | 1 | 1 | 0% | 1,569 | 4,539 | +189% | 0 | 0 | — |
case-15 | pass→pass | 9,990 | 6,808 | -32% | 1 | 1 | 0% | 2,167 | 5,111 | +136% | 0 | 0 | — |
case-16 | pass→pass | 12,130 | 10,495 | -13% | 1 | 1 | 0% | 2,593 | 5,859 | +126% | 0 | 0 | — |
case-17 | fail→pass | 3,610 | 2,248 | -38% | 1 | 1 | 0% | 648 | 3,972 | +513% | 0 | 0 | — |
case-18 | fail→fail | 11,299 | 10,305 | -9% | 1 | 1 | 0% | 2,867 | 6,124 | +114% | 0 | 0 | — |
case-19 | pass→pass | 4,653 | 4,478 | -4% | 1 | 1 | 0% | 1,046 | 4,530 | +333% | 0 | 0 | — |
case-20 | fail→fail | 11,018 | 10,426 | -5% | 1 | 1 | 0% | 2,398 | 5,772 | +141% | 0 | 0 | — |
case-21 | fail→fail | 14,813 | 10,550 | -29% | 1 | 1 | 0% | 2,873 | 5,547 | +93% | 0 | 0 | — |
case-22 | fail→fail | 12,694 | 11,739 | -8% | 1 | 1 | 0% | 2,725 | 6,156 | +126% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +18 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.