refactor: 将数据获取从app端移至server端
- 调整数据获取位置以提升安全性 - 对于后端状态为Archived的数据,通过server控制不进行获取
This commit is contained in:
9
graphql/companyProfile.graphql
Normal file
9
graphql/companyProfile.graphql
Normal file
@ -0,0 +1,9 @@
|
||||
query GetCompanyProfile($locale: String!) {
|
||||
company_profile {
|
||||
id
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
content
|
||||
}
|
||||
}
|
||||
}
|
||||
9
graphql/contactInfo.graphql
Normal file
9
graphql/contactInfo.graphql
Normal file
@ -0,0 +1,9 @@
|
||||
query GetContactInfo($locale: String!) {
|
||||
contact_info {
|
||||
id
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
content
|
||||
}
|
||||
}
|
||||
}
|
||||
31
graphql/documentList.graphql
Normal file
31
graphql/documentList.graphql
Normal file
@ -0,0 +1,31 @@
|
||||
query GetDocumentList($locale: String!) {
|
||||
product_documents(filter: { status: { _eq: "published" } }) {
|
||||
id
|
||||
file {
|
||||
id
|
||||
filesize
|
||||
filename_download
|
||||
}
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
title
|
||||
}
|
||||
products {
|
||||
id
|
||||
products_id {
|
||||
id
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
name
|
||||
}
|
||||
product_type {
|
||||
id
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
33
graphql/homepage.graphql
Normal file
33
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
65
graphql/product.graphql
Normal file
65
graphql/product.graphql
Normal file
@ -0,0 +1,65 @@
|
||||
query GetProduct($id: ID!, $locale: String!) {
|
||||
products_by_id(id: $id) {
|
||||
id
|
||||
status
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
name
|
||||
summary
|
||||
description
|
||||
}
|
||||
images {
|
||||
id
|
||||
product_images_id {
|
||||
id
|
||||
image {
|
||||
id
|
||||
}
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
caption
|
||||
}
|
||||
}
|
||||
}
|
||||
specs {
|
||||
id
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
name
|
||||
}
|
||||
specs {
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
key
|
||||
value
|
||||
}
|
||||
}
|
||||
}
|
||||
faqs {
|
||||
id
|
||||
questions_id(filter: { status: { _eq: "published" } }) {
|
||||
id
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
title
|
||||
content
|
||||
}
|
||||
}
|
||||
}
|
||||
documents {
|
||||
id
|
||||
product_documents_id(filter: { status: { _eq: "published" } }) {
|
||||
id
|
||||
file {
|
||||
id
|
||||
filesize
|
||||
filename_download
|
||||
}
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
22
graphql/productList.graphql
Normal file
22
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
|
||||
}
|
||||
}
|
||||
}
|
||||
27
graphql/questionList.graphql
Normal file
27
graphql/questionList.graphql
Normal file
@ -0,0 +1,27 @@
|
||||
query GetQuestionList($locale: String!) {
|
||||
questions(filter: { status: { _eq: "published" } }) {
|
||||
id
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
title
|
||||
content
|
||||
}
|
||||
products {
|
||||
id
|
||||
products_id {
|
||||
id
|
||||
product_type {
|
||||
id
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
graphql/solution.graphql
Normal file
12
graphql/solution.graphql
Normal file
@ -0,0 +1,12 @@
|
||||
query GetSolution($id: ID!, $locale: String!) {
|
||||
solutions_by_id(id: $id) {
|
||||
id
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
title
|
||||
summary
|
||||
content
|
||||
}
|
||||
create_at
|
||||
}
|
||||
}
|
||||
21
graphql/solutionList.graphql
Normal file
21
graphql/solutionList.graphql
Normal file
@ -0,0 +1,21 @@
|
||||
query GetSolutionList($locale: String!) {
|
||||
solutions(filter: { status: { _eq: "published" } }) {
|
||||
id
|
||||
cover {
|
||||
id
|
||||
}
|
||||
type {
|
||||
id
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
name
|
||||
}
|
||||
sort
|
||||
}
|
||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||
id
|
||||
title
|
||||
summary
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user