mirror of
https://github.com/vercel/commerce.git
synced 2025-05-13 05:07:51 +00:00
37 lines
910 B
TypeScript
37 lines
910 B
TypeScript
import customerDetailsFragment from '../fragments/customer-details';
|
|
|
|
const customerFragment = `#graphql
|
|
`;
|
|
|
|
// NOTE: https://shopify.dev/docs/api/customer/latest/queries/customer
|
|
export const getCustomerOrdersQuery = `#graphql
|
|
query getCustomerOrdersQuery {
|
|
customer {
|
|
...CustomerDetails
|
|
}
|
|
}
|
|
${customerFragment}
|
|
${customerDetailsFragment}
|
|
`;
|
|
|
|
export const getCustomerOrderMetafieldsQuery = /* GraphQL */ `
|
|
query getCustomerOrderMetafields($id: ID!) {
|
|
customer(id: $id) {
|
|
orders(first: 20, sortKey: PROCESSED_AT, reverse: true) {
|
|
nodes {
|
|
id
|
|
warrantyStatus: metafield(namespace: "custom", key: "warranty_status") {
|
|
value
|
|
}
|
|
warrantyActivationDeadline: metafield(
|
|
namespace: "custom"
|
|
key: "warranty_activation_deadline"
|
|
) {
|
|
value
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|