← Back to list

graphql-guide
by simula-labs
⭐ 0🍴 0📅 Jan 16, 2026
SKILL.md
name: graphql-guide description: GraphQL development best practices. Use when working with fragments, queries, mutations, or .graphql files.
GraphQL Guide
命名パターン(ベストプラクティス)
| タイプ | パターン | 例 |
|---|---|---|
| Fragment | [Component][Model]Fragment | UserCardFragment |
| Query | [Action][Resource]Query | GetUsersQuery |
| Mutation | [Verb][Target]Mutation | CreateUserMutation |
| Subscription | [Entity]Subscription | UserUpdatedSubscription |
ファイル命名
<type>.<GraphQLName>.graphql
- type:
fragment|query|mutation|subscription - GraphQLName: PascalCaseで記述
パターン別
| タイプ | パターン | 例 |
|---|---|---|
| Fragment | fragment.<Component><Model>.graphql | fragment.CardTask.graphql |
| Query (Get) | query.Get<Context><Resource>.graphql | query.GetDetailPageCraft.graphql |
| Query (Search) | query.Search<Target>.graphql | query.SearchCompanies.graphql |
| Mutation | mutation.<Verb><Resource>.graphql | mutation.CreateTask.graphql |
| Subscription | subscription.Subscribe<Event>.graphql | subscription.SubscribeCraftTimeline.graphql |
コロケーションパターン
GraphQLファイルは使用するコンポーネントの近くに配置:
components/
└── UserCard/
├── index.tsx
└── graphql/
└── fragment.UserCard.graphql
Verb一覧(Mutation用)
| Verb | 用途 |
|---|---|
| Create | 新規作成 |
| Update | 更新 |
| Delete | 削除 |
| Add | 関連追加 |
| Remove | 関連削除 |
| Submit | 提出 |
| Cancel | キャンセル |
Fragment First
- コンポーネントが必要なデータをFragmentで定義
- 親がFragmentをQuery/Mutationに埋め込み
- データの責務が明確になる
# fragment.UserCard.graphql
fragment UserCardFragment on User {
id
name
avatarUrl
}
# query.GetUsers.graphql
query GetUsersQuery {
users {
...UserCardFragment
}
}
Score
Total Score
55/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
○言語
プログラミング言語が設定されている
0/5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon