Skip to content

[codex] 駅詳細のGraphQLフラグメントを整理して取得項目を軽量化 - #5807

Merged
TinyKitten merged 2 commits into
devfrom
fix/station-fragment-fields-lightening
Apr 11, 2026
Merged

TinyKitten merged 2 commits into
devfrom
fix/station-fragment-fields-lightening

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Apr 11, 2026 •

Copy link
Copy Markdown
Member

概要

  • StationFields で参照する line / lines 向けに LineInStationFields を追加しました
  • 駅詳細で不要な項目を外し、駅画面向けに必要なフィールドへ取得内容を整理しました
  • 生成された GraphQL 型定義を更新し、Biome で整形しました

変更理由

駅詳細で使う LineNested フラグメントが広すぎたため、不要なフィールドまで取得していました。駅画面で必要な項目に絞ることで、クエリと生成型の両方を軽量化します。

影響

  • 駅詳細系クエリの取得項目が縮小されます
  • StationFields に依存する型定義が更新されます
  • UI の期待値は維持したまま、不要なデータ取得を減らします

確認

  • npm run lint
  • npm run typecheck

Summary by CodeRabbit

リリースノート

  • 改善
    • ステーション関連のデータ取得を最適化し、路線データの取得効率が向上して応答がより高速になりました。
    • ステーション詳細の表示項目を整理しました(ステータス・距離・ローマ字発音などの一部項目を削減)。路線レベルの交通種別は維持しています。

@coderabbitai

coderabbitai Bot commented Apr 11, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5a74a414-6621-4ef6-ab00-e999e2ba5281

📥 Commits

Reviewing files that changed from the base of the PR and between ffa542b and 53542b1.

📒 Files selected for processing (1)
  • src/lib/graphql/queries.ts

📝 Walkthrough

ウォークスルー

GraphQL クエリ定義に新しい LINE_IN_STATION_FRAGMENT を追加し、STATION_FRAGMENT の line/lines 選択を LINE_NESTED_FRAGMENT から新フラグメントへ切り替え。合わせて STATION_FRAGMENT から nameRomanIpa、status、distance、transportType を削除。

変更内容

コホート / ファイル 概要
GraphQL フラグメント定義
src/lib/graphql/queries.ts
新しい LINE_IN_STATION_FRAGMENT を追加。STATION_FRAGMENT の line と lines で使用するフラグメントを LINE_NESTED_FRAGMENT から LINE_IN_STATION_FRAGMENT に変更し、STATION_FRAGMENT から nameRomanIpa、status、distance、transportType を削除。

推定コードレビュー工数

🎯 3 (Moderate) | ⏱️ ~20 minutes

ポエム

🐰 フラグメントひとつ、すっきりと
駅の線だけを軽やかに抱えて
余分な荷を下ろして跳ねるよ
コードの草原でぴょんと一歩
🚉✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PRのタイトルは、GraphQLフラグメント整理による取得項目軽量化という、実装の主要な変更を明確に要約しており、変更内容と一致しています。
Description check ✅ Passed PRの説明は、概要、変更理由、影響を記載し、テスト実施内容も記載されており、テンプレートの主要セクションをカバーしています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/station-fragment-fields-lightening

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the react label Apr 11, 2026
@TinyKitten TinyKitten self-assigned this Apr 11, 2026
@TinyKitten
TinyKitten marked this pull request as ready for review April 11, 2026 10:15

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/lib/graphql/queries.ts`:
- Around line 112-124: The fragment inclusion is inconsistent: you import/inject
COMPANY_FRAGMENT but inside fragment LineInStationFields on LineNested you list
company fields inline instead of using the CompanyFields fragment; replace the
inline company field selections with the fragment spread ...CompanyFields so the
COMPANY_FRAGMENT (CompanyFields) is actually referenced and NoUnusedFragments
validation passes (update the fragment LineInStationFields on LineNested to use
...CompanyFields within the company selection; keep the surrounding fragments
like LINE_SYMBOL_FRAGMENT, STATION_NUMBER_FRAGMENT, and TTS_SEGMENT_FRAGMENT
unchanged).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 872eb1c3-54b8-4518-b638-a90e0b43c91b

📥 Commits

Reviewing files that changed from the base of the PR and between 4bf4978 and ffa542b.

📒 Files selected for processing (2)
  • src/@types/graphql.d.ts
  • src/lib/graphql/queries.ts

Comment thread src/lib/graphql/queries.ts Resolved
@TinyKitten
TinyKitten merged commit ad2f345 into dev Apr 11, 2026
5 checks passed
@TinyKitten
TinyKitten deleted the fix/station-fragment-fields-lightening branch April 11, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant