regenerate-types
Regenerate TypeScript types from GraphQL schema using Apollo codegen. Use when the user asks to update types, regenerate types, run codegen, after GraphQL schema changes, after database migrations, or after modifying Hasura metadata.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Regenerate GraphQL Types
Prerequisites
- Hasura must be running and accessible at
http://localhost:8080/v1/graphql - Start with:
docker compose up hasura(from project root)
Quick Command
Run from the frontend-nx directory with the GraphQL URI:
cd frontend-nx && GRAPHQL_URI=http://localhost:8080/v1/graphql yarn nx run edu-hub:apollo
For rent-a-scientist:
cd frontend-nx && GRAPHQL_URI=http://localhost:8080/v1/graphql yarn nx run rent-a-scientist:apollo
When to Run
Run codegen after:
- Adding new GraphQL queries or mutations
- Modifying existing queries
- Backend schema changes (new tables, columns, relationships)
- Pulling changes that include query modifications
Troubleshooting
"Connection refused" or similar network errors
Ensure Hasura is running:
docker compose up hasura
Types not updating
Clear and regenerate:
rm -rf frontend-nx/apps/edu-hub/queries/__generated__/*
cd frontend-nx && GRAPHQL_URI=http://localhost:8080/v1/graphql yarn nx run edu-hub:apollo
Generated Files Location
- edu-hub:
frontend-nx/apps/edu-hub/queries/__generated__/ - rent-a-scientist:
frontend-nx/apps/rent-a-scientist/queries/__generated__/
Related Skills
If you're making database schema changes, ensure you also:
- Create migrations using the
create-migrationskill - Update Hasura metadata if adding tables/relationships
- THEN regenerate types using this skill
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!