Chloe d801de0cf1
finish activate warranty logic
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
2024-06-26 09:44:58 +07:00

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
}
}
}
}
}
`;