Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

マスターデータの取得 #65

Open
okazy opened this issue Jul 29, 2020 · 1 comment
Open

マスターデータの取得 #65

okazy opened this issue Jul 29, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@okazy
Copy link
Contributor

okazy commented Jul 29, 2020

マスターデータの取得方法が現状でGraphQLを辿っていくしかない。
マスターデータを取得できる方法が欲しい。

案1: Queryで取得

マスターデータ取得用のクエリを実装

query {
  orderStatuses {
    id
    name
  }
}

案2: Schemaで取得

enumでスキーマを定義

enum OrderStatus {
  NEW
  CANCEL
  IN_PROGRESS
  ...
}

案2は既存のEC-CUBEのコードからSchemaを生成するのが難しいので諦めざるを得ないか。。。
(CountryやJobなどのマスターデータは英語の変数名を持っていないので自動生成できない??)

@okazy
Copy link
Contributor Author

okazy commented Jul 31, 2020

今のQueryの機構でマスタテーブルのクエリを全て追加するのはクラスファイル数が冗長になってしまうと思います。
以下のようにすれば1ファイルの追加で実装できそうです。

query {
  masters {
    orderStatuses {
      id
      name
    }
  }
}

@okazy okazy added the enhancement New feature or request label Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant