feat(saleor): Phase 1 - GraphQL Client Setup
- 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
This commit is contained in:
21
src/lib/saleor/queries/Checkout.ts
Normal file
21
src/lib/saleor/queries/Checkout.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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}
|
||||
`;
|
||||
`;
|
||||
Reference in New Issue
Block a user