Business-trip attendee mutations throw TypeError instead of a clear error when no row is affected

オープン 初心者向け
#4,917 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
graphql, typescript

調査の方向性

packages/server/src/modules/business-trips/resolvers/business-trip-attendees.resolver.tsと、空の結果になるケースを確認するためにproviders/business-trips-attendees.provider.ts:48-52のproviderクエリを読んでください。これら3つのmutationのテストを見つけ、重複挿入と、更新および削除時にattendeeが見つからないケースのテストを追加してください。各空の結果で明確なGraphQLErrorが発生し、3つすべてのケースがテストされていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

In packages/server/src/modules/business-trips/resolvers/business-trip-attendees.resolver.ts, all three mutations end in .then(res => res[0].attendee_business_id):

  • insertBusinessTripAttendee: the SQL is INSERT … ON CONFLICT DO NOTHING RETURNING * (providers/business-trips-attendees.provider.ts:48-52). Adding an attendee who is already on the trip returns no rows, so res[0] is undefined and the client gets TypeError: Cannot read properties of undefined.
  • updateBusinessTripAttendee / deleteBusinessTripAttendee: these crash the same way when the attendee isn't on the trip.

Done when: each mutation checks for an empty result and throws a GraphQLError with a clear message (e.g. "Attendee is already part of this business trip" / "Attendee not found on this business trip"), with tests for each.


Generated by Claude Code

主要言語
TypeScript
スター
30
フォーク
10
平均マージ
2日 12時間
マージ済み PR(30日)
276

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Urigo/accounter-fullstack のほかの issue

Urigo/accounter-fullstack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。