GraphQL Caching with GraphCDN

7 Mar 2022

query {
  cart(id: "graphcdn") {
    id
    totalItems
    items {
      id
      name
      unitTotal {
        amount
        formatted
      }
      lineTotal {
        amount
        formatted
      }
    }
    grandTotal {
      amount
      formatted
    }
  }
}
mutation {
  addItem(
    input: {
      cartId: "graphcdn"
      id: "item-id-1"
      name: "GraphCDN T-Shirt"
      description: "As worn by Max"
      images: ["graphcdn-tee-white-front.png", "graphcdn-tee-white-back.png"]
      price: 1590
    }
  ) {
    id
    isEmpty
    abandoned
    totalItems
    totalUniqueItems
    items {
      id
      name
      quantity
      images
      unitTotal {
        amount
        formatted
      }
      lineTotal {
        amount
        formatted
      }
    }
    subTotal {
      formatted
    }
  }
}