diff --git a/framework/saleor/common/get-all-pages.ts b/framework/saleor/common/get-all-pages.ts index 4aa90fce5..b3ee07dc2 100644 --- a/framework/saleor/common/get-all-pages.ts +++ b/framework/saleor/common/get-all-pages.ts @@ -29,9 +29,9 @@ const getAllPages = async (options?: { const { data } = await config.fetch(getAllPagesQuery, { variables }) const pages = data.pages?.edges?.map( - ({ node: { title: name, handle, ...node } }: PageEdge) => ({ + ({ node: { title: name, slug, ...node } }: PageCountableEdge) => ({ ...node, - url: `/${locale}/${handle}`, + url: `/${locale}/${slug}`, name, }) ) diff --git a/framework/saleor/common/get-page.ts b/framework/saleor/common/get-page.ts index a3759ff41..bbe74cd85 100644 --- a/framework/saleor/common/get-page.ts +++ b/framework/saleor/common/get-page.ts @@ -21,14 +21,14 @@ const getPage = async (options: { const { data } = await config.fetch(getPageQuery, { variables, }) - const page = data.node + const page = data.page return { page: page ? { ...page, name: page.title, - url: `/${locale}/${page.handle}`, + url: `/${locale}/${page.slug}`, } : null, } diff --git a/framework/saleor/product/get-all-product-paths.ts b/framework/saleor/product/get-all-product-paths.ts index 71bd7fd27..447944865 100644 --- a/framework/saleor/product/get-all-product-paths.ts +++ b/framework/saleor/product/get-all-product-paths.ts @@ -33,7 +33,7 @@ const getAllProductPaths = async (options?: { return { products: products?.map(({ node: { slug } }: ProductCountableEdge) => ({ node: { - path: `/${handle}`, + path: `/${slug}`, }, })), } diff --git a/framework/saleor/utils/queries/get-page-query.ts b/framework/saleor/utils/queries/get-page-query.ts index 2ca79abd4..5cdf6cfc5 100644 --- a/framework/saleor/utils/queries/get-page-query.ts +++ b/framework/saleor/utils/queries/get-page-query.ts @@ -1,13 +1,9 @@ export const getPageQuery = /* GraphQL */ ` query($id: ID!) { - node(id: $id) { + page(id: $id) { id - ... on Page { - title - handle - body - bodySummary - } + title + slug } } `