mirror of
https://github.com/vercel/commerce.git
synced 2025-07-27 04:01:23 +00:00
Shopify Provier Updates (#212)
* changes * Adding shopify commit * Changed to query page by id * Fixed page query, Changed use-search GraphQl query * Update use-search.tsx * remove unused util * Changed cookie expiration * Update tsconfig.json Co-authored-by: okbel <curciobel@gmail.com>
This commit is contained in:
@@ -1,3 +1,38 @@
|
||||
export const productConnection = `
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
hasPreviousPage
|
||||
}
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
title
|
||||
vendor
|
||||
handle
|
||||
description
|
||||
priceRange {
|
||||
minVariantPrice {
|
||||
amount
|
||||
currencyCode
|
||||
}
|
||||
}
|
||||
images(first: 1) {
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
hasPreviousPage
|
||||
}
|
||||
edges {
|
||||
node {
|
||||
originalSrc
|
||||
altText
|
||||
width
|
||||
height
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
export const productsFragment = `
|
||||
products(
|
||||
first: $first
|
||||
@@ -5,39 +40,7 @@ products(
|
||||
reverse: $reverse
|
||||
query: $query
|
||||
) {
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
hasPreviousPage
|
||||
}
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
title
|
||||
vendor
|
||||
handle
|
||||
description
|
||||
priceRange {
|
||||
minVariantPrice {
|
||||
amount
|
||||
currencyCode
|
||||
}
|
||||
}
|
||||
images(first: 1) {
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
hasPreviousPage
|
||||
}
|
||||
edges {
|
||||
node {
|
||||
originalSrc
|
||||
altText
|
||||
width
|
||||
height
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
${productConnection}
|
||||
}
|
||||
`
|
||||
|
||||
|
@@ -1,16 +1,23 @@
|
||||
import { productsFragment } from './get-all-products-query'
|
||||
import { productConnection } from './get-all-products-query'
|
||||
|
||||
const getCollectionProductsQuery = /* GraphQL */ `
|
||||
query getProductsFromCollection(
|
||||
$categoryHandle: String!
|
||||
$categoryId: ID!
|
||||
$first: Int = 250
|
||||
$query: String = ""
|
||||
$sortKey: ProductSortKeys = RELEVANCE
|
||||
$sortKey: ProductCollectionSortKeys = RELEVANCE
|
||||
$reverse: Boolean = false
|
||||
) {
|
||||
collectionByHandle(handle: $categoryHandle)
|
||||
{
|
||||
${productsFragment}
|
||||
node(id: $categoryId) {
|
||||
id
|
||||
... on Collection {
|
||||
products(
|
||||
first: $first
|
||||
sortKey: $sortKey
|
||||
reverse: $reverse
|
||||
) {
|
||||
${productConnection}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
@@ -1,12 +1,13 @@
|
||||
export const getPageQuery = /* GraphQL */ `
|
||||
query getPageBySlug($slug: String!) {
|
||||
pageByHandle(handle: $slug) {
|
||||
query($id: ID!) {
|
||||
node(id: $id) {
|
||||
id
|
||||
title
|
||||
handle
|
||||
body
|
||||
bodySummary
|
||||
url
|
||||
... on Page {
|
||||
title
|
||||
handle
|
||||
body
|
||||
bodySummary
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
@@ -32,6 +32,7 @@ const getProductQuery = /* GraphQL */ `
|
||||
node {
|
||||
id
|
||||
title
|
||||
sku
|
||||
selectedOptions {
|
||||
name
|
||||
value
|
||||
|
Reference in New Issue
Block a user