Back to list
simula-labs

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]FragmentUserCardFragment
Query[Action][Resource]QueryGetUsersQuery
Mutation[Verb][Target]MutationCreateUserMutation
Subscription[Entity]SubscriptionUserUpdatedSubscription

ファイル命名

<type>.<GraphQLName>.graphql
  • type: fragment | query | mutation | subscription
  • GraphQLName: PascalCaseで記述

パターン別

タイプパターン
Fragmentfragment.<Component><Model>.graphqlfragment.CardTask.graphql
Query (Get)query.Get<Context><Resource>.graphqlquery.GetDetailPageCraft.graphql
Query (Search)query.Search<Target>.graphqlquery.SearchCompanies.graphql
Mutationmutation.<Verb><Resource>.graphqlmutation.CreateTask.graphql
Subscriptionsubscription.Subscribe<Event>.graphqlsubscription.SubscribeCraftTimeline.graphql

コロケーションパターン

GraphQLファイルは使用するコンポーネントの近くに配置:

components/
└── UserCard/
    ├── index.tsx
    └── graphql/
        └── fragment.UserCard.graphql

Verb一覧(Mutation用)

Verb用途
Create新規作成
Update更新
Delete削除
Add関連追加
Remove関連削除
Submit提出
Cancelキャンセル

Fragment First

  1. コンポーネントが必要なデータをFragmentで定義
  2. 親がFragmentをQuery/Mutationに埋め込み
  3. データの責務が明確になる
# 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