vtex-io-graphql-api

Build and validate GraphQL schemas, resolvers, and directives for VTEX IO apps.

39|9|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/vtex/ai-skills --skill vtex-io-graphql-api-vtex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vtex-io-graphql-api
Source: https://github.com/vtex/ai-skills/tree/main/tracks/vtex-io/skills/vtex-io-graphql-api
Command: npx skills add https://github.com/vtex/ai-skills --skill vtex-io-graphql-api-vtex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GraphQL API development for VTEX IO apps requires careful wiring of schemas, resolvers, and directives to ensure correct data exposure, caching, and authentication. This skill provides a structured blueprint to define GraphQL schemas in the graphql directory, implement resolvers in node/resolvers, and register them in the Service with proper directive usage.

Core Features & Use Cases

  • Defines and validates the GraphQL schema and type definitions in GraphQL directories.
  • Wires resolvers in the Service entry point to match schema fields and uses ctx.clients for data access.
  • Enforces and documents the use of @cacheControl and @auth directives to ensure correct caching and security.
  • Use Case: Build a VTEX IO app that exposes a public product graph with caching and protected mutations.

Quick Start

Use this skill to guide building a VTEX IO GraphQL API by wiring schemas, directives, and resolvers.

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 build a GraphQL API on VTEX IO with caching and authentication?

To build a VTEX IO GraphQL API, define type definitions in the graphql directory, implement resolvers in node/resolvers, and register them in the Service while applying @cacheControl and @auth directives for caching and security.

What is the correct directory structure for VTEX IO GraphQL resolvers and schemas?

VTEX IO GraphQL APIs require schema definitions in the graphql directory and resolver implementations in node/resolvers. Resolvers are then wired into the Service entry point to match the defined schema fields.

How do I enforce authentication and caching in a VTEX IO GraphQL API?

Enforce authentication and caching in a VTEX IO GraphQL API by applying the @auth and @cacheControl directives directly within your schema definitions to secure mutations and manage data exposure.

How do resolvers access data in the VTEX IO service context?

Resolvers access data within the VTEX IO service context by using ctx.clients. This ensures that data retrieval correctly matches the schema fields and operates within the proper VTEX IO application environment.

Can I validate that my VTEX IO GraphQL resolvers match the schema fields?

Yes, this process validates that resolvers match schema fields. It enforces correct data exposure by ensuring resolvers are properly wired in the Service entry point and aligned with the GraphQL type definitions.

What's the best way to expose a public product graph with protected mutations in VTEX IO?

To expose a public product graph with protected mutations, define your GraphQL schema in VTEX IO and apply @cacheControl for data caching alongside @auth directives to secure the mutation operations.