vtex-io-graphql-api
БесплатноБез исполняемых скриптовНе проверенApply when working with GraphQL schema files in graphql/ or implementing resolvers in node/resolvers/ for VTEX IO apps. Covers schema.graphql definitions…
от vtex★ 47 звёзд на GitHubОб этом скилле
GraphQL Schemas & Resolvers
When this skill applies
Use this skill when your VTEX IO app needs to expose a GraphQL API — either for frontend React components to query, for other VTEX IO apps to consume, or for implementing custom data aggregation layers over VTEX Commerce APIs.
- Defining schemas in
.graphqlfiles in the/graphqldirectory - Writing resolver functions in TypeScript in
/node/resolvers/ - Configuring
@cacheControland@authdirectives - Wiring resolvers into the Service class
Do not use this skill for:
- Backend service structure and client system (use
vtex-io-service-appsinstead) - Manifest and builder configuration (use
vtex-io-app-structureinstead) - MasterData integration details (use
vtex-io-masterdatainstead)
Decision rules
- The
graphqlbuilder processes.graphqlfiles in/graphqland merges them into a single schema. - Split definitions across multiple files for maintainability:
schema.graphqlfor root types,directives.graphqlfor directive declarations,types/*.graphqlfor custom types. - Use
@cacheControl(scope: PUBLIC, maxAge: SHORT|MEDIUM|LONG)on all public Query fields.PUBLIC= shared CDN cache,PRIVATE= per-user cache. - Use
@authon all Mutations and on Queries that return sensitive or user-specific data. - Never use
@cacheControlon Mutations. - Resolver function keys in the Service entry point MUST exactly match the field names in
schema.graphql. - Always use
ctx.clientsin resolvers for data access — never raw HTTP calls.
Recommended directory structure:
graphql/
├── schema.graphql # Query and Mutation root type definitions
├── directives.graphql # Custom directive declarations (@cacheControl, @auth)
└── types/
├── Review.graphql # Custom type definitions
└── Product.graphql # One file per type for organization
Built-in directives:
@cacheControl:scope(PUBLIC/PRIVATE),maxAge(SHORT30s,MEDIUM5min,LONG1h)@auth: Enforces valid VTEX authentication token. Without it, unauthenticated users can call the endpoint.@smartcache: Automatically caches query results in VTEX infrastructure.
Hard constraints
Constraint: Declare the graphql Builder
Any app using .graphql schema files MUST declare the graphql builder in manifest.json. The graphql builder interprets the schema and registers it with the VTEX IO runtime.
Why this matters
Without the graphql builder declaration, the /graphql directory is completely ignored. Schema files will not be processed, resolvers will not be registered, and GraphQL queries will return "schema not found" errors. The app will link without errors but GraphQL will silently not work.
Detection
If you see .graphql files in a /graphql directory but the manifest does not include "graphql": "1.x" in builders, STOP and add the builder declaration.
Correct
{
"builders": {
"node": "7.x",
"graphql": "1.x"
}
}
Wrong
{
"builders": {
"node": "7.x"
}
}
Missing "graphql": "1.x" — the /graphql directory with schema files is ignored. GraphQL queries return errors because no schema is registered. The app links successfully, masking the problem.
Constraint: Use @cacheControl on Public Queries
All public-facing Query fields (those fetching data that is not user-specific) MUST include the @cacheControl directive with an appropriate scope and maxAge. Mutations MUST NOT use @cacheControl.
Why this matters
Without @cacheControl, every query hits your resolver on every request — no CDN caching, no edge caching, no shared caching. This leads to unnecessary load on VTEX infrastructure, slow response times, and potential rate limiting. For public product data, caching is critical for performance.
Detection
If a Query field returns public data (not user-specific) and does not have @cacheControl, warn the developer to add it. If a Mutation has @cacheControl, STOP and remove it.
Correct
type Query {
reviews(productId: String!, limit: Int): [Review]
@cacheControl(scope: PUBLIC, maxAge: SHORT)
productMetadata(slug: String!): ProductMetadata
@cacheControl(scope: PUBLIC, maxAge: MEDIUM)
myReviews: [Review]
@cacheControl(scope: PRIVATE, maxAge: SHORT)
@auth
}
type Mutation {
createReview(review: ReviewInput!): Review @auth
}
Wrong
type Query {
reviews(productId: String!, limit: Int): [Review]
myReviews: [Review]
}
type Mutation {
createReview(review: ReviewInput!): Review
@cacheControl(scope: PUBLIC, maxAge: LONG)
}
No cache control on queries (every request hits the resolver), missing @auth on user-specific data, and @cacheControl on a mutation (makes no sense).
Constraint: Resolver Names Must Match Schema Fields
Resolver function keys in the Service entry point MUST exactly match the field names defined in `schema.g
Установить vtex-io-graphql-api в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл vtex-io-graphql-api?
Apply when working with GraphQL schema files in graphql/ or implementing resolvers in node/resolvers/ for VTEX IO apps. Covers schema.graphql definitions, @cacheControl and @auth directives, custom type definitions, and resolver registration in the Service class. Use for exposing data through GraphQL queries and mutations with proper cache control and authentication enforcement.
Как установить скилл vtex-io-graphql-api?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл vtex-io-graphql-api запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic