← Public packages
@kody/shopify
Shopify Admin API helpers for products, orders, customers, and GraphQL — secret-backed, no OAuth app.
src/lib/fragments.ts
81 lines · 1015 B · TypeScriptexport const PAGE_INFO_FIELDS = `
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
`
export const MONEY_SET_FIELDS = `
shopMoney { amount currencyCode }
`
export const PRODUCT_FIELDS = `
id
title
handle
status
vendor
productType
tags
createdAt
updatedAt
totalInventory
description
variants(first: 50) {
nodes {
id
title
sku
barcode
price
compareAtPrice
inventoryQuantity
}
}
`
export const ORDER_FIELDS = `
id
name
email
createdAt
updatedAt
displayFinancialStatus
displayFulfillmentStatus
note
tags
currentTotalPriceSet { ${MONEY_SET_FIELDS} }
customer { id displayName email }
lineItems(first: 50) {
nodes {
id
title
sku
quantity
originalUnitPriceSet { ${MONEY_SET_FIELDS} }
}
}
`
export const CUSTOMER_FIELDS = `
id
displayName
firstName
lastName
email
phone
createdAt
updatedAt
numberOfOrders
amountSpent { amount currencyCode }
defaultAddress {
id
formatted
city
province
country
zip
}
`