microsoft / microsoft/cppgraphqlgen

Fragments should generate their own structs

オープン
#280 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

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

主要言語
C++
スター
350
フォーク
56
平均マージ
2時間 33分
マージ済み PR(30日)
3

説明

When generating a client using fragments and lots of similar queries that use the same fragment it leads to lots of the same structs being generated.

Ideally there would be a seperate Fragments struct that contains the defined fragments.

I.e the following queries would both share the same response structs as they use the same fragment:

fragment LoadInfo on Load {
    loadId
    jobContainerId
    name
    loadPlanStatus
    journey {
        journeyId
    }
}

query loadById($load: Int!) {
    loadByID(loadId: $load) {
        ...LoadInfo
    }
}

query loadBySupplier($supplier: String!, $after: LocalDateTime!) {
    loadsBySupplierId(supplierCode: $supplier, after: $after) {
        ...LoadInfo
    }
}

Not sure how feasible that is, but I think something similar is done for input types and enums?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

調査の方向性

ファイル、テスト、エントリポイントは指定されていません。まず、generator が input types と enums を既存のコードでどのように処理しているかを追跡し、次に fragment が所有する structs をどのように出力して再利用するかを定義します。両方のサンプルクエリが、重複した定義なしに fragment response structs を共有すれば完了です。

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

評価

技術スタック
cpp, graphql
領域
backend-api-design, tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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