feat: get-blog-detail and relevant blogs

This commit is contained in:
Quangnhankie
2021-10-20 10:11:07 +07:00
parent abea83cdd6
commit 7ea734d0ad
16 changed files with 459 additions and 98 deletions

View File

@@ -0,0 +1,11 @@
export const getAllBlogPathsQuery = /* GraphQL */ `
query getAllBlogPaths($excludeBlogIds: [ID]! = [],$options:BlogListOptions){
blogs(excludeBlogIds: $excludeBlogIds,options: $options){
items{
translations {
slug
}
}
}
}
`

View File

@@ -0,0 +1,26 @@
export const getBlogDetailQuery = /* GraphQL */ `
query getBlog($slug: String ){
blog(slug: $slug){
id
isPublish
isFeatured
authorName
createdAt
authorAvatarAsset{
preview
}
featuredAsset {
preview
}
translations {
title
slug
description
content
}
relevantProducts{
id
}
}
}
`

View File

@@ -0,0 +1,25 @@
export const getRelevantBlogsQuery = /* GraphQL */ `
query relevantBlogs($productId: ID!){
relevantBlogs(productId:$productId){
items {
id
isPublish
isFeatured
authorName
createdAt
authorAvatarAsset{
preview
}
featuredAsset {
preview
}
translations {
title
slug
description
content
}
}
}
}
`