detail page port

This commit is contained in:
nicwands
2026-05-29 11:22:56 -04:00
parent b85d28c142
commit e22d75c50a
65 changed files with 7006 additions and 4044 deletions

83
libs/shopify/customer.js Normal file
View File

@@ -0,0 +1,83 @@
import { gql } from 'graphql-request'
import { IMAGE_FRAGMENT, PRICE_FRAGMENT } from './fragments'
export const GET_CUSTOMER = gql`
${IMAGE_FRAGMENT}
${PRICE_FRAGMENT}
query getCustomer {
customer {
id
defaultAddress {
address1
address2
city
zoneCode
zip
country
}
firstName
lastName
emailAddress {
emailAddress
}
orders(first: 100) {
edges {
node {
id
name
number
createdAt
statusPageUrl
totalPrice {
amount
currencyCode
}
lineItems(first: 100) {
edges {
node {
id
name
image {
...ImageFields
}
price {
...PriceFields
}
}
}
}
}
}
}
}
}
`
export const UPDATE_CUSTOMER = gql`
mutation updateCustomerAndAddress(
$address: CustomerAddressInput!
$input: CustomerUpdateInput!
) {
customerAddressCreate(address: $address, defaultAddress: true) {
customerAddress {
address1
address2
city
province
country
}
userErrors {
code
field
message
}
}
customerUpdate(input: $input) {
customer {
firstName
lastName
}
}
}
`