mirror of
https://github.com/vercel/commerce.git
synced 2025-07-27 04:01:23 +00:00
feat: get-blog-detail and relevant blogs
This commit is contained in:
11
framework/vendure/utils/queries/get-all-blog-paths-query.ts
Normal file
11
framework/vendure/utils/queries/get-all-blog-paths-query.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export const getAllBlogPathsQuery = /* GraphQL */ `
|
||||
query getAllBlogPaths($excludeBlogIds: [ID]! = [],$options:BlogListOptions){
|
||||
blogs(excludeBlogIds: $excludeBlogIds,options: $options){
|
||||
items{
|
||||
translations {
|
||||
slug
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
26
framework/vendure/utils/queries/get-blog-detail.ts
Normal file
26
framework/vendure/utils/queries/get-blog-detail.ts
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
25
framework/vendure/utils/queries/get-relevant-blogs.ts
Normal file
25
framework/vendure/utils/queries/get-relevant-blogs.ts
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
Reference in New Issue
Block a user