Back to list
lmiguelvargasf

graphql-contract

by lmiguelvargasf

🌟 Modern full-stack template using Python (Litestar) and TypeScript (Next.js).

2🍴 0📅 Jan 20, 2026

SKILL.md


name: graphql-contract description: > Use when changing GraphQL schema, resolvers, or frontend GraphQL documents so the contract and codegen stay in sync.

GraphQL contract & sync

When to use

  • You modify backend GraphQL types/resolvers or the schema.
  • You add or edit frontend .graphql documents.
  • You suspect schema and generated types are out of sync.

Steps

  1. Backend: implement changes under backend/src/backend/apps/**/graphql/.
  2. Sync: run task frontend:codegen from the repo root.
    • This runs task backend:schema:export to update frontend/schema/schema.graphql.
    • Then runs pnpm codegen to regenerate TypeScript types.
  3. Frontend: update frontend/src/ to use the newly generated types/fragments.
  4. Verify: run task frontend:check.

Constraints and guardrails

  • The Strawberry backend is the source of truth; do not manually edit frontend/schema/schema.graphql.
  • Do not hand-write TypeScript interfaces for GraphQL results; use generated types in frontend/src/lib/graphql/.
  • Schema changes and frontend sync should be in the same change set.
  • Breaking changes (removing/renaming fields, Nullable → Non-Null, adding required args) require immediate frontend updates after codegen.
  • Avoid N+1 by using SQLAlchemy eager loading (selectinload/joinedload) and moving complex logic into services.

References

  • backend/src/backend/apps/**/graphql/
  • frontend/schema/schema.graphql
  • frontend/src/lib/graphql/
  • frontend/**/codegen.*

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon