refactor: 产品页与产品列表的API重构
- 将产品页与产品列表的API由REST重构为GraphQL - 修改Mapper与单元测试
This commit is contained in:
22
app/graphql/productList.graphql
Normal file
22
app/graphql/productList.graphql
Normal file
@ -0,0 +1,22 @@
|
||||
query GetProductList($locale: String!) {
|
||||
products(filter: { status: { _eq: "in-production" } }) {
|
||||
id
|
||||
status
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
name
|
||||
summary
|
||||
}
|
||||
cover {
|
||||
id
|
||||
}
|
||||
product_type {
|
||||
id
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
name
|
||||
}
|
||||
sort
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user