vtex-io-graphql-api

Implement VTEX IO GraphQL APIs with schema, resolvers, caching, and authorization.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/exilonX/ap2 --skill vtex-io-graphql-api-exilonx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vtex-io-graphql-api
Source: https://github.com/exilonX/ap2/tree/main/.agents/skills/vtex-io-graphql-api
Command: npx skills add https://github.com/exilonX/ap2 --skill vtex-io-graphql-api-exilonx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents broken or insecure GraphQL endpoints in VTEX IO by guiding how to define schemas, register resolvers, and enforce caching and authentication consistently.

Core Features & Use Cases

  • GraphQL schema definition: Organizes .graphql files for a unified schema, including root Query/Mutation types and custom types.
  • Resolver wiring & correctness: Ensures resolver keys match schema fields exactly and are registered through the Service entry point.
  • Performance & security guardrails: Applies @cacheControl to public Query fields, forbids caching on Mutations, and uses @auth for protected or sensitive operations.

Quick Start

Use the vtex-io-graphql-api skill to define your VTEX IO app’s GraphQL schema.graphql, add @cacheControl and @auth where required, and implement resolver functions in node/resolvers/ that match your schema field names.

Frequently Asked Questions about vtex-io-graphql-api

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

FAQPage Schema
How do I set up a GraphQL API in VTEX IO with correct schema and resolvers?

To set up a VTEX IO GraphQL API, declare the graphql builder in manifest.json, organize .graphql files for schema types, and register TypeScript resolvers through the Service entry point with keys matching schema fields exactly.

Why does my VTEX IO GraphQL resolver return an error when the schema field name is slightly different?

VTEX IO GraphQL resolvers fail when resolver keys do not exactly match the schema field names defined in your .graphql files. Ensure your TypeScript resolver object keys are identical to the Query and Mutation field names.

Should I add @cacheControl to Mutations in my VTEX IO GraphQL schema?

You should not add @cacheControl to Mutations in a VTEX IO GraphQL schema. Caching is only applied to public Query fields to improve performance, while Mutations must remain uncached to ensure data integrity.

Can I use custom directives like @auth for authorization in VTEX IO GraphQL endpoints?

You can enforce authorization in VTEX IO GraphQL endpoints by applying the @auth directive to protected or sensitive fields. This ensures access is validated before executing the resolver logic for those operations.

Do I need to use ctx.clients for data access inside VTEX IO GraphQL resolvers?

Yes, you should use ctx.clients for data access inside VTEX IO GraphQL resolvers. This ensures consistent client instantiation and proper integration with external APIs and VTEX platform services.

What is the best way to secure and cache a VTEX IO GraphQL endpoint?

The best way to secure and cache a VTEX IO GraphQL endpoint is to apply @cacheControl on public Query fields for performance and use @auth directives on sensitive operations, while routing data access through ctx.clients.