Nghiên cứu queries trong graphql full (ok)
Cart
ADD_TO_CART_MUTATION theo kiểu fragment
export const ADD_TO_CART_MUTATION = gql`
mutation AddToCart( $productId: Int! $variationId: Int $quantity: Int $extraData: String ) {
addToCart(
input: {
productId: $productId
variationId: $variationId
quantity: $quantity
extraData: $extraData
}
) {
cart {
...CartContent
}
cartItem {
...CartItemContent
}
}
}
${CartContent}
${CartItemContent}
`;
export const CartContent = gql`
fragment CartContent on Cart {
contents(first: 100) {
itemCount
nodes {
...CartItemContent
}
}
appliedCoupons {
code
discountAmount
discountTax
}
needsShippingAddress
availableShippingMethods {
rates {
id
instanceId
methodId
label
cost
}
}
chosenShippingMethods
subtotal(format: RAW)
subtotalTax(format: RAW)
shippingTax(format: RAW)
shippingTotal(format: RAW)
total(format: RAW)
totalTax(format: RAW)
feeTax(format: RAW)
feeTotal(format: RAW)
discountTax(format: RAW)
discountTotal(format: RAW)
fees {
id
name
total
}
appliedCoupons {
description
code
description
discountAmount
}
}
${CartItemContent}
`;
export const CartItemContent = gql`
fragment CartItemContent on CartItem {
key
product {
node {
...ProductContentSlice
}
}
variation {
node {
...ProductVariationContentSlice
}
}
quantity
total
subtotal
subtotalTax
totalOnSaleDiscount
extraData {
key
value
}
}
${ProductContentSlice}
${ProductVariationContentSlice}
`;
export const ProductContentSlice = gql`
fragment ProductContentSlice on Product {
id
databaseId
name
slug
type
image {
id
sourceUrl(size: WOOCOMMERCE_SINGLE)
altText
}
... on SimpleProduct {
price
regularPrice
soldIndividually
}
... on VariableProduct {
price
regularPrice
soldIndividually
}
}
`;
export const ProductVariationContentSlice = gql`
fragment ProductVariationContentSlice on ProductVariation {
id
databaseId
name
slug
attributes {
nodes {
id
label
value
name
}
}
image {
id
sourceUrl(size: WOOCOMMERCE_SINGLE)
altText
}
price
regularPrice
salePrice
discountAmount
discountPercentage
stockStatus
}
`;
test 1
mutation AddToCartT{
addToCart(
input: {
productId: 1774
variationId: 1790
quantity: 2
extraData: ""
}
) {
cart {
...CartContent
}
cartItem {
...CartItemContent
}
}
}
fragment CartContent on Cart {
contents(first: 100) {
itemCount
nodes {
...CartItemContent
}
}
appliedCoupons {
code
discountAmount
discountTax
}
needsShippingAddress
availableShippingMethods {
rates {
id
instanceId
methodId
label
cost
}
}
chosenShippingMethods
subtotal(format: RAW)
subtotalTax(format: RAW)
shippingTax(format: RAW)
shippingTotal(format: RAW)
total(format: RAW)
totalTax(format: RAW)
feeTax(format: RAW)
feeTotal(format: RAW)
discountTax(format: RAW)
discountTotal(format: RAW)
fees {
id
name
total
}
appliedCoupons {
description
code
description
discountAmount
}
}
fragment CartItemContent on CartItem {
key
product {
node {
...ProductContentSlice
}
}
variation {
node {
...ProductVariationContentSlice
}
}
quantity
total
subtotal
subtotalTax
totalOnSaleDiscount
extraData {
key
value
}
}
fragment ProductContentSlice on Product {
id
databaseId
name
slug
type
image {
id
sourceUrl(size: WOOCOMMERCE_SINGLE)
altText
}
... on SimpleProduct {
price
regularPrice
soldIndividually
}
... on VariableProduct {
price
regularPrice
soldIndividually
}
}
fragment ProductVariationContentSlice on ProductVariation {
id
databaseId
name
slug
attributes {
nodes {
id
label
value
name
}
}
image {
id
sourceUrl(size: WOOCOMMERCE_SINGLE)
altText
}
price
regularPrice
salePrice
discountAmount
discountPercentage
stockStatus
}
{
"data": {
"addToCart": {
"cart": {
"contents": {
"itemCount": 3,
"nodes": [
{
"key": "e9b73bccd1762555582b513ff9d02492",
"product": {
"node": {
"id": "cHJvZHVjdDoxNzc3",
"databaseId": 1777,
"name": "Beanie",
"slug": "beanie",
"type": "SIMPLE",
"image": {
"id": "cG9zdDoxODA2",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/beanie-2-416x416.jpg",
"altText": ""
},
"price": "18 ₫",
"regularPrice": "20 ₫",
"soldIndividually": false
}
},
"variation": null,
"quantity": 1,
"total": "18 ₫",
"subtotal": "18 ₫",
"subtotalTax": "0 ₫",
"totalOnSaleDiscount": 0,
"extraData": []
},
{
"key": "19f6eb66e580666ea01a86a19bad0822",
"product": {
"node": {
"id": "cHJvZHVjdDoxNzc0",
"databaseId": 1774,
"name": "Hoodie",
"slug": "hoodie",
"type": "VARIABLE",
"image": {
"id": "cG9zdDoxODAx",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/hoodie-2-416x416.jpg",
"altText": ""
},
"price": "42 ₫ - 65 ₫",
"regularPrice": "50 ₫ - 65 ₫",
"soldIndividually": false
}
},
"variation": {
"node": {
"id": "cHJvZHVjdF92YXJpYXRpb246MTc5MA==",
"databaseId": 1790,
"name": "Hoodie - Red, Medium",
"slug": "hoodie-red-no",
"attributes": {
"nodes": [
{
"id": "MTc5MHx8cGFfY29sb3J8fHJlZA==",
"label": "Color",
"value": "Red",
"name": "pa_color"
},
{
"id": "MTc5MHx8cGFfc2l6ZXx8bWVkaXVt",
"label": "Size",
"value": "Medium",
"name": "pa_size"
}
]
},
"image": {
"id": "cG9zdDoxODAx",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/hoodie-2-416x416.jpg",
"altText": ""
},
"price": "42 ₫",
"regularPrice": "50 ₫",
"salePrice": "42 ₫",
"discountAmount": 8,
"discountPercentage": 16,
"stockStatus": "IN_STOCK"
}
},
"quantity": 2,
"total": "84 ₫",
"subtotal": "84 ₫",
"subtotalTax": "0 ₫",
"totalOnSaleDiscount": 16,
"extraData": []
}
]
},
"appliedCoupons": null,
"needsShippingAddress": true,
"availableShippingMethods": [
{
"rates": [
{
"id": "free_shipping:1",
"instanceId": 1,
"methodId": "free_shipping",
"label": "Free shipping",
"cost": null
}
]
}
],
"chosenShippingMethods": [
"free_shipping:1"
],
"subtotal": "102",
"subtotalTax": "0",
"shippingTax": "0",
"shippingTotal": "0",
"total": "102",
"totalTax": "0",
"feeTax": "0",
"feeTotal": "0",
"discountTax": "0",
"discountTotal": "0",
"fees": null
},
"cartItem": {
"key": "19f6eb66e580666ea01a86a19bad0822",
"product": {
"node": {
"id": "cHJvZHVjdDoxNzc0",
"databaseId": 1774,
"name": "Hoodie",
"slug": "hoodie",
"type": "VARIABLE",
"image": {
"id": "cG9zdDoxODAx",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/hoodie-2-416x416.jpg",
"altText": ""
},
"price": "42 ₫ - 65 ₫",
"regularPrice": "50 ₫ - 65 ₫",
"soldIndividually": false
}
},
"variation": {
"node": {
"id": "cHJvZHVjdF92YXJpYXRpb246MTc5MA==",
"databaseId": 1790,
"name": "Hoodie - Red, Medium",
"slug": "hoodie-red-no",
"attributes": {
"nodes": [
{
"id": "MTc5MHx8cGFfY29sb3J8fHJlZA==",
"label": "Color",
"value": "Red",
"name": "pa_color"
},
{
"id": "MTc5MHx8cGFfc2l6ZXx8bWVkaXVt",
"label": "Size",
"value": "Medium",
"name": "pa_size"
}
]
},
"image": {
"id": "cG9zdDoxODAx",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/hoodie-2-416x416.jpg",
"altText": ""
},
"price": "42 ₫",
"regularPrice": "50 ₫",
"salePrice": "42 ₫",
"discountAmount": 8,
"discountPercentage": 16,
"stockStatus": "IN_STOCK"
}
},
"quantity": 2,
"total": "84 ₫",
"subtotal": "84 ₫",
"subtotalTax": "0 ₫",
"totalOnSaleDiscount": 16,
"extraData": []
}
}
},
"extensions": {
"debug": [],
"queryLog": [
"Query Logging has been disabled. The 'SAVEQUERIES' Constant is set to 'false' on your server."
],
"queryAnalyzer": {
"keys": "9d0b6876f8d0342e95d0f558b84c33226aa80a83858fd76eb92dc799acad41aa graphql:Mutation operation:AddToCartT cG9zdDoxODAx cG9zdDoxODA2",
"keysLength": 128,
"keysCount": 5,
"skippedKeys": "",
"skippedKeysSize": 0,
"skippedKeysCount": 0,
"skippedTypes": []
}
}
}
GET_CART_QUERY
query MyQuery {
cart {
contents(first: 100) {
itemCount
nodes {
key
product {
node {
id
databaseId
name
slug
type
image {
id
sourceUrl(size: WOOCOMMERCE_SINGLE)
}
}
}
}
}
}
}
{
"data": {
"cart": {
"contents": {
"itemCount": 3,
"nodes": [
{
"key": "e9b73bccd1762555582b513ff9d02492",
"product": {
"node": {
"id": "cHJvZHVjdDoxNzc3",
"databaseId": 1777,
"name": "Beanie",
"slug": "beanie",
"type": "SIMPLE",
"image": {
"id": "cG9zdDoxODA2",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/beanie-2-416x416.jpg",
"altText": ""
},
"price": "18 ₫",
"regularPrice": "20 ₫",
"soldIndividually": false
}
},
"variation": null,
"quantity": 1,
"total": "18 ₫",
"subtotal": "18 ₫",
"subtotalTax": "0 ₫",
"totalOnSaleDiscount": 0,
"extraData": []
},
{
"key": "19f6eb66e580666ea01a86a19bad0822",
"product": {
"node": {
"id": "cHJvZHVjdDoxNzc0",
"databaseId": 1774,
"name": "Hoodie",
"slug": "hoodie",
"type": "VARIABLE",
"image": {
"id": "cG9zdDoxODAx",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/hoodie-2-416x416.jpg",
"altText": ""
},
"price": "42 ₫ - 65 ₫",
"regularPrice": "50 ₫ - 65 ₫",
"soldIndividually": false
}
},
"variation": {
"node": {
"id": "cHJvZHVjdF92YXJpYXRpb246MTc5MA==",
"databaseId": 1790,
"name": "Hoodie - Red, Medium",
"slug": "hoodie-red-no",
"attributes": {
"nodes": [
{
"id": "MTc5MHx8cGFfY29sb3J8fHJlZA==",
"label": "Color",
"value": "Red",
"name": "pa_color"
},
{
"id": "MTc5MHx8cGFfc2l6ZXx8bWVkaXVt",
"label": "Size",
"value": "Medium",
"name": "pa_size"
}
]
},
"image": {
"id": "cG9zdDoxODAx",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/hoodie-2-416x416.jpg",
"altText": ""
},
"price": "42 ₫",
"regularPrice": "50 ₫",
"salePrice": "42 ₫",
"discountAmount": 8,
"discountPercentage": 16,
"stockStatus": "IN_STOCK"
}
},
"quantity": 2,
"total": "84 ₫",
"subtotal": "84 ₫",
"subtotalTax": "0 ₫",
"totalOnSaleDiscount": 16,
"extraData": []
}
]
},
"appliedCoupons": null,
"needsShippingAddress": true,
"availableShippingMethods": [
{
"rates": [
{
"id": "free_shipping:1",
"instanceId": 1,
"methodId": "free_shipping",
"label": "Free shipping",
"cost": null
}
]
}
],
"chosenShippingMethods": [
"free_shipping:1"
],
"subtotal": "102",
"subtotalTax": "0",
"shippingTax": "0",
"shippingTotal": "0",
"total": "102",
"totalTax": "0",
"feeTax": "0",
"feeTotal": "0",
"discountTax": "0",
"discountTotal": "0",
"fees": null
}
},
"extensions": {
"debug": [],
"queryLog": [
"Query Logging has been disabled. The 'SAVEQUERIES' Constant is set to 'false' on your server."
],
"queryAnalyzer": {
"keys": "353deb1af331abf2dd83dfcfb50dffa3068627da68c111c7de37c692d0bd7574 graphql:Mutation operation:GetCart cG9zdDoxODA2 cG9zdDoxODAx",
"keysLength": 125,
"keysCount": 5,
"skippedKeys": "",
"skippedKeysSize": 0,
"skippedKeysCount": 0,
"skippedTypes": []
}
}
}
UPDATE_CART_ITEMS_QUANTITIES_MUTATION
— Vối key e9b73bccd1762555582b513ff9d02492 "variation": null
mutation UpdateCartItemQuantities {
updateItemQuantities(
input: {items: {key: "e9b73bccd1762555582b513ff9d02492", quantity: 10}}
) {
cart {
...CartContent
}
items {
...CartItemContent
}
}
}
{
"data": {
"updateItemQuantities": {
"cart": {
"contents": {
"itemCount": 12,
"nodes": [
{
"key": "e9b73bccd1762555582b513ff9d02492",
"product": {
"node": {
"id": "cHJvZHVjdDoxNzc3",
"databaseId": 1777,
"name": "Beanie",
"slug": "beanie",
"type": "SIMPLE",
"image": {
"id": "cG9zdDoxODA2",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/beanie-2-416x416.jpg",
"altText": ""
},
"price": "18 ₫",
"regularPrice": "20 ₫",
"soldIndividually": false
}
},
"variation": null,
"quantity": 10,
"total": "180 ₫",
"subtotal": "180 ₫",
"subtotalTax": "0 ₫",
"totalOnSaleDiscount": 0,
"extraData": []
},
{
"key": "19f6eb66e580666ea01a86a19bad0822",
"product": {
"node": {
"id": "cHJvZHVjdDoxNzc0",
"databaseId": 1774,
"name": "Hoodie",
"slug": "hoodie",
"type": "VARIABLE",
"image": {
"id": "cG9zdDoxODAx",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/hoodie-2-416x416.jpg",
"altText": ""
},
"price": "42 ₫ - 65 ₫",
"regularPrice": "50 ₫ - 65 ₫",
"soldIndividually": false
}
},
"variation": {
"node": {
"id": "cHJvZHVjdF92YXJpYXRpb246MTc5MA==",
"databaseId": 1790,
"name": "Hoodie - Red, Medium",
"slug": "hoodie-red-no",
"attributes": {
"nodes": [
{
"id": "MTc5MHx8cGFfY29sb3J8fHJlZA==",
"label": "Color",
"value": "Red",
"name": "pa_color"
},
{
"id": "MTc5MHx8cGFfc2l6ZXx8bWVkaXVt",
"label": "Size",
"value": "Medium",
"name": "pa_size"
}
]
},
"image": {
"id": "cG9zdDoxODAx",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/hoodie-2-416x416.jpg",
"altText": ""
},
"price": "42 ₫",
"regularPrice": "50 ₫",
"salePrice": "42 ₫",
"discountAmount": 8,
"discountPercentage": 16,
"stockStatus": "IN_STOCK"
}
},
"quantity": 2,
"total": "84 ₫",
"subtotal": "84 ₫",
"subtotalTax": "0 ₫",
"totalOnSaleDiscount": 16,
"extraData": []
}
]
},
"appliedCoupons": null,
"needsShippingAddress": true,
"availableShippingMethods": [
{
"rates": [
{
"id": "free_shipping:1",
"instanceId": 1,
"methodId": "free_shipping",
"label": "Free shipping",
"cost": null
}
]
}
],
"chosenShippingMethods": [
"free_shipping:1"
],
"subtotal": "264",
"subtotalTax": "0",
"shippingTax": "0",
"shippingTotal": "0",
"total": "264",
"totalTax": "0",
"feeTax": "0",
"feeTotal": "0",
"discountTax": "0",
"discountTotal": "0",
"fees": null
},
"items": [
{
"key": "e9b73bccd1762555582b513ff9d02492",
"product": {
"node": {
"id": "cHJvZHVjdDoxNzc3",
"databaseId": 1777,
"name": "Beanie",
"slug": "beanie",
"type": "SIMPLE",
"image": {
"id": "cG9zdDoxODA2",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/beanie-2-416x416.jpg",
"altText": ""
},
"price": "18 ₫",
"regularPrice": "20 ₫",
"soldIndividually": false
}
},
"variation": null,
"quantity": 10,
"total": "180 ₫",
"subtotal": "180 ₫",
"subtotalTax": "0 ₫",
"totalOnSaleDiscount": 0,
"extraData": []
}
]
}
},
"extensions": {
"debug": [],
"queryLog": [
"Query Logging has been disabled. The 'SAVEQUERIES' Constant is set to 'false' on your server."
],
"queryAnalyzer": {
"keys": "44cb04b9a242b1fc610b47a7bba94a27d6f6404158f63b281834167e8c340d7a graphql:Mutation operation:UpdateCartItemQuantities cG9zdDoxODA2 cG9zdDoxODAx",
"keysLength": 142,
"keysCount": 5,
"skippedKeys": "",
"skippedKeysSize": 0,
"skippedKeysCount": 0,
"skippedTypes": []
}
}
}
— Vối key 19f6eb66e580666ea01a86a19bad0822 "variation": !null
mutation UpdateCartItemQuantities {
updateItemQuantities(
input: {items: {key: "19f6eb66e580666ea01a86a19bad0822", quantity: 12}}
) {
cart {
...CartContent
}
items {
...CartItemContent
}
}
}
{
"data": {
"updateItemQuantities": {
"cart": {
"contents": {
"itemCount": 22,
"nodes": [
{
"key": "e9b73bccd1762555582b513ff9d02492",
"product": {
"node": {
"id": "cHJvZHVjdDoxNzc3",
"databaseId": 1777,
"name": "Beanie",
"slug": "beanie",
"type": "SIMPLE",
"image": {
"id": "cG9zdDoxODA2",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/beanie-2-416x416.jpg",
"altText": ""
},
"price": "18 ₫",
"regularPrice": "20 ₫",
"soldIndividually": false
}
},
"variation": null,
"quantity": 10,
"total": "180 ₫",
"subtotal": "180 ₫",
"subtotalTax": "0 ₫",
"totalOnSaleDiscount": 0,
"extraData": []
},
{
"key": "19f6eb66e580666ea01a86a19bad0822",
"product": {
"node": {
"id": "cHJvZHVjdDoxNzc0",
"databaseId": 1774,
"name": "Hoodie",
"slug": "hoodie",
"type": "VARIABLE",
"image": {
"id": "cG9zdDoxODAx",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/hoodie-2-416x416.jpg",
"altText": ""
},
"price": "42 ₫ - 65 ₫",
"regularPrice": "50 ₫ - 65 ₫",
"soldIndividually": false
}
},
"variation": {
"node": {
"id": "cHJvZHVjdF92YXJpYXRpb246MTc5MA==",
"databaseId": 1790,
"name": "Hoodie - Red, Medium",
"slug": "hoodie-red-no",
"attributes": {
"nodes": [
{
"id": "MTc5MHx8cGFfY29sb3J8fHJlZA==",
"label": "Color",
"value": "Red",
"name": "pa_color"
},
{
"id": "MTc5MHx8cGFfc2l6ZXx8bWVkaXVt",
"label": "Size",
"value": "Medium",
"name": "pa_size"
}
]
},
"image": {
"id": "cG9zdDoxODAx",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/hoodie-2-416x416.jpg",
"altText": ""
},
"price": "42 ₫",
"regularPrice": "50 ₫",
"salePrice": "42 ₫",
"discountAmount": 8,
"discountPercentage": 16,
"stockStatus": "IN_STOCK"
}
},
"quantity": 12,
"total": "504 ₫",
"subtotal": "504 ₫",
"subtotalTax": "0 ₫",
"totalOnSaleDiscount": 96,
"extraData": []
}
]
},
"appliedCoupons": null,
"needsShippingAddress": true,
"availableShippingMethods": [
{
"rates": [
{
"id": "free_shipping:1",
"instanceId": 1,
"methodId": "free_shipping",
"label": "Free shipping",
"cost": null
}
]
}
],
"chosenShippingMethods": [
"free_shipping:1"
],
"subtotal": "684",
"subtotalTax": "0",
"shippingTax": "0",
"shippingTotal": "0",
"total": "684",
"totalTax": "0",
"feeTax": "0",
"feeTotal": "0",
"discountTax": "0",
"discountTotal": "0",
"fees": null
},
"items": [
{
"key": "19f6eb66e580666ea01a86a19bad0822",
"product": {
"node": {
"id": "cHJvZHVjdDoxNzc0",
"databaseId": 1774,
"name": "Hoodie",
"slug": "hoodie",
"type": "VARIABLE",
"image": {
"id": "cG9zdDoxODAx",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/hoodie-2-416x416.jpg",
"altText": ""
},
"price": "42 ₫ - 65 ₫",
"regularPrice": "50 ₫ - 65 ₫",
"soldIndividually": false
}
},
"variation": {
"node": {
"id": "cHJvZHVjdF92YXJpYXRpb246MTc5MA==",
"databaseId": 1790,
"name": "Hoodie - Red, Medium",
"slug": "hoodie-red-no",
"attributes": {
"nodes": [
{
"id": "MTc5MHx8cGFfY29sb3J8fHJlZA==",
"label": "Color",
"value": "Red",
"name": "pa_color"
},
{
"id": "MTc5MHx8cGFfc2l6ZXx8bWVkaXVt",
"label": "Size",
"value": "Medium",
"name": "pa_size"
}
]
},
"image": {
"id": "cG9zdDoxODAx",
"sourceUrl": "https://funtapgames.com/wp-content/uploads/2025/02/hoodie-2-416x416.jpg",
"altText": ""
},
"price": "42 ₫",
"regularPrice": "50 ₫",
"salePrice": "42 ₫",
"discountAmount": 8,
"discountPercentage": 16,
"stockStatus": "IN_STOCK"
}
},
"quantity": 12,
"total": "504 ₫",
"subtotal": "504 ₫",
"subtotalTax": "0 ₫",
"totalOnSaleDiscount": 96,
"extraData": []
}
]
}
},
"extensions": {
"debug": [],
"queryLog": [
"Query Logging has been disabled. The 'SAVEQUERIES' Constant is set to 'false' on your server."
],
"queryAnalyzer": {
"keys": "a43efff8b0c05d00f38ab39cd639bdc1c1e6cabb0a34817c1cbf36717ce4bbed graphql:Mutation operation:UpdateCartItemQuantities cG9zdDoxODAx cG9zdDoxODA2",
"keysLength": 142,
"keysCount": 5,
"skippedKeys": "",
"skippedKeysSize": 0,
"skippedKeysCount": 0,
"skippedTypes": []
}
}
}
Toàn bộ code để check trong graphql
mutation AddToCartT {
__typename
}
fragment CartContent on Cart {
contents(first: 100) {
itemCount
nodes {
...CartItemContent
}
}
appliedCoupons {
code
discountAmount
discountTax
}
needsShippingAddress
availableShippingMethods {
rates {
id
instanceId
methodId
label
cost
}
}
chosenShippingMethods
subtotal(format: RAW)
subtotalTax(format: RAW)
shippingTax(format: RAW)
shippingTotal(format: RAW)
total(format: RAW)
totalTax(format: RAW)
feeTax(format: RAW)
feeTotal(format: RAW)
discountTax(format: RAW)
discountTotal(format: RAW)
fees {
id
name
total
}
appliedCoupons {
description
code
description
discountAmount
}
}
fragment CartItemContent on CartItem {
key
product {
node {
...ProductContentSlice
}
}
variation {
node {
...ProductVariationContentSlice
}
}
quantity
total
subtotal
subtotalTax
totalOnSaleDiscount
extraData {
key
value
}
}
fragment ProductContentSlice on Product {
id
databaseId
name
slug
type
image {
id
sourceUrl(size: WOOCOMMERCE_SINGLE)
altText
}
... on SimpleProduct {
price
regularPrice
soldIndividually
}
... on VariableProduct {
price
regularPrice
soldIndividually
}
}
fragment ProductVariationContentSlice on ProductVariation {
id
databaseId
name
slug
attributes {
nodes {
id
label
value
name
}
}
image {
id
sourceUrl(size: WOOCOMMERCE_SINGLE)
altText
}
price
regularPrice
salePrice
discountAmount
discountPercentage
stockStatus
}
query GetCart {
cart {
...CartContent
}
}
mutation UpdateCartItemQuantities {
updateItemQuantities(
input: {items: {key: "19f6eb66e580666ea01a86a19bad0822", quantity: 12}}
) {
cart {
...CartContent
}
items {
...CartItemContent
}
}
}
PreviousCách mở rộng interface, type trong core nextjs (ok)NextLàm chức năng đăng ký bằng google cho nextjs typescript với wordpress. đọc thêm
Last updated
Was this helpful?