- Add Apollo Client for Saleor GraphQL API - Create GraphQL fragments (Product, Variant, Checkout) - Create GraphQL queries (Products, Checkout) - Create GraphQL mutations (Checkout operations) - Add TypeScript types for Saleor entities - Add product helper functions - Install @apollo/client and graphql dependencies Part of WordPress/WooCommerce → Saleor migration
22 lines
425 B
TypeScript
22 lines
425 B
TypeScript
import { gql } from "@apollo/client";
|
|
import { CHECKOUT_FRAGMENT } from "../fragments/Checkout";
|
|
|
|
export const GET_CHECKOUT = gql`
|
|
query GetCheckout($token: UUID!) {
|
|
checkout(token: $token) {
|
|
...CheckoutFragment
|
|
}
|
|
}
|
|
${CHECKOUT_FRAGMENT}
|
|
`;
|
|
|
|
export const GET_CHECKOUT_BY_ID = gql`
|
|
query GetCheckoutById($id: ID!) {
|
|
checkout(id: $id) {
|
|
...CheckoutFragment
|
|
}
|
|
}
|
|
${CHECKOUT_FRAGMENT}
|
|
`;
|
|
`;
|