refactor: 调整首页数据获取API
- 将首页的数据获取由REST重构为GraphQL
This commit is contained in:
33
app/graphql/homepage.graphql
Normal file
33
app/graphql/homepage.graphql
Normal file
@ -0,0 +1,33 @@
|
||||
query GetHomepage($locale: String!) {
|
||||
homepage {
|
||||
id
|
||||
carousel {
|
||||
id
|
||||
directus_files_id {
|
||||
id
|
||||
}
|
||||
}
|
||||
recommend_products {
|
||||
id
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
name
|
||||
summary
|
||||
}
|
||||
cover {
|
||||
id
|
||||
}
|
||||
}
|
||||
recommend_solutions {
|
||||
id
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
title
|
||||
summary
|
||||
}
|
||||
cover {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user