mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
wip: Story detail page
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
editCartItemsMutation,
|
||||
removeFromCartMutation
|
||||
} from './mutations/cart';
|
||||
import { getBlogQuery } from './queries/blog';
|
||||
import { getBlogArticleQuery, getBlogQuery } from './queries/blog';
|
||||
import { getCartQuery } from './queries/cart';
|
||||
import {
|
||||
getCollectionProductsQuery,
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
} from './queries/product';
|
||||
import {
|
||||
Blog,
|
||||
BlogArticle,
|
||||
Cart,
|
||||
Collection,
|
||||
Connection,
|
||||
@@ -34,6 +35,7 @@ import {
|
||||
Product,
|
||||
ShopifyAddToCartOperation,
|
||||
ShopifyBlog,
|
||||
ShopifyBlogArticleOperation,
|
||||
ShopifyBlogOperation,
|
||||
ShopifyCart,
|
||||
ShopifyCartOperation,
|
||||
@@ -433,6 +435,25 @@ export async function getBlog({
|
||||
return reshapeBlog(res.body.data.blogByHandle);
|
||||
}
|
||||
|
||||
export async function getBlogArticle({
|
||||
handle,
|
||||
articleHandle,
|
||||
language,
|
||||
country
|
||||
}: {
|
||||
handle: string;
|
||||
articleHandle: string;
|
||||
language?: string;
|
||||
country?: string;
|
||||
}): Promise<BlogArticle | undefined> {
|
||||
const res = await shopifyFetch<ShopifyBlogArticleOperation>({
|
||||
query: getBlogArticleQuery,
|
||||
variables: { handle, articleHandle, language, country }
|
||||
});
|
||||
|
||||
return res.body.data.blogByHandle.articleByHandle;
|
||||
}
|
||||
|
||||
export async function getProduct({
|
||||
handle,
|
||||
language,
|
||||
|
Reference in New Issue
Block a user