refactor: 调整首页数据获取API

- 将首页的数据获取由REST重构为GraphQL
This commit is contained in:
2025-11-11 16:14:58 +08:00
parent a93f508e85
commit ac658e01ae
4 changed files with 40 additions and 47 deletions

View 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
}
}
}
}