graphql-schema
Generate GraphQL queries and mutations
Writing GraphQL operations manually leads to type errors and maintenance headaches. This skill provides proven patterns for queries, mutations, and Apollo Client integration with automatic type generation.
Descargar el ZIP de la skill
Subir en Claude
Ve a Configuración → Capacidades → Skills → Subir skill
Activa y empieza a usar
Pruébalo
Usando "graphql-schema". Create a query to fetch users with their roles
Resultado esperado:
- Create src/queries/GetUsers.gql with the GraphQL query definition
- Run npm run gql:typegen to generate the hook
- Import useGetUsersQuery from the generated file
- Use the hook with variables and handle loading/error states
- Apollo handles caching automatically with cache-first policy
Usando "graphql-schema". How do I create a mutation with optimistic response
Resultado esperado:
- Define the mutation in a .gql file with input type
- Generate types with codegen
- Use useMutation hook with optimisticResponse field
- Provide onError handler to rollback on failure
- Update cache in update callback after success
Auditoría de seguridad
SeguroThis skill contains only documentation and metadata. No executable code, network calls, file access, or command execution. Static findings are false positives triggered by markdown code blocks, content hashes, and documentation patterns. The skill provides GraphQL development guidance only.
Factores de riesgo
🌐 Acceso a red (1)
📁 Acceso al sistema de archivos (1)
⚙️ Comandos externos (36)
Puntuación de calidad
Lo que puedes crear
Set up GraphQL queries
Create type-safe GraphQL queries with generated Apollo hooks for React components
Add mutations with error handling
Implement mutations with required error handlers, loading states, and cache updates
Automate type generation
Generate TypeScript types from .gql files to eliminate manual type maintenance
Prueba estos prompts
Show me how to create a GraphQL query for fetching items with pagination. Include the .gql file and how to use the generated hook.
How do I create a GraphQL mutation for creating a new item? Include error handling and cache update patterns.
Show me how to implement optimistic updates for a toggle mutation so the UI updates instantly before the server responds.
What are the requirements for error handling in GraphQL mutations? Show a complete pattern with logging and user feedback.
Mejores prácticas
- Never inline gql literals - use separate .gql files for maintainability
- Always run codegen after modifying .gql files to update types
- Add onError handlers to all mutations with user feedback
- Use generated hooks instead of raw Apollo hooks
Evitar
- Inline gql strings in component files - creates hard-to-maintain code
- Skipping error handlers on mutations - users see silent failures
- Using raw useMutation instead of generated hooks - loses type safety
- Not disabling buttons during mutations - allows duplicate submissions
Preguntas frecuentes
Does this skill connect to my GraphQL server?
What GraphQL clients are supported?
What codegen tools work with these patterns?
Is my data safe when using this skill?
Why should I use .gql files instead of inline gql?
How is this different from writing raw GraphQL?
Detalles del desarrollador
Autor
ChrisWilesLicencia
MIT
Repositorio
https://github.com/ChrisWiles/claude-code-showcase/tree/main/.claude/skills/graphql-schemaRef.
main
Estructura de archivos
📄 SKILL.md