Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ Optional plugin:
The current release has been tested and is confirmed working with the following plugin versions:

- WordPress version 6.1.1
- WooCommerce version 7.1.0
- WP GraphQL version 1.5.0
- WooGraphQL version 0.6.2
- WooCommerce version 7.4.0
- WP GraphQL version 1.13.8
- WooGraphQL version 0.12.0
- WPGraphQL CORS version 2.1

2. Make sure WooCommerce has some products already or import some sample products

Expand Down
72 changes: 38 additions & 34 deletions apollo/mutations/ADD_TO_CART_MUTATION.gql
Original file line number Diff line number Diff line change
@@ -1,51 +1,55 @@
mutation($input: AddToCartInput!) {
mutation ($input: AddToCartInput!) {
addToCart(input: $input) {
cartItem {
key
product {
id
databaseId
name
description
type
onSale
slug
averageRating
reviewCount
image {
node {
id
sourceUrl
altText
}
galleryImages {
nodes {
databaseId
name
description
type
onSale
slug
averageRating
reviewCount
image {
id
sourceUrl
altText
}
galleryImages {
nodes {
id
sourceUrl
altText
}
}
}
}
variation {
id
databaseId
name
description
type
onSale
price
regularPrice
salePrice
image {
node {
id
sourceUrl
altText
}
attributes {
nodes {
databaseId
name
description
type
onSale
price
regularPrice
salePrice
image {
id
attributeId
name
value
sourceUrl
altText
}
attributes {
nodes {
id
attributeId
name
value
}
}
}
}
Expand Down
101 changes: 59 additions & 42 deletions apollo/mutations/UPDATE_CART_MUTATION.gql
Original file line number Diff line number Diff line change
@@ -1,54 +1,60 @@
mutation($input: UpdateItemQuantitiesInput!) {
mutation ($input: UpdateItemQuantitiesInput!) {
updateItemQuantities(input: $input) {
items {
key
product {
id
databaseId
name
description
type
onSale
slug
averageRating
reviewCount
image {
node {
id
sourceUrl
altText
}
galleryImages {
nodes {
databaseId
name
description
type
onSale
slug
averageRating
reviewCount
image {
id
sourceUrl
altText
}
galleryImages {
nodes {
id
sourceUrl
altText
}
}
}
}

variation {
id
databaseId
name
description
type
onSale
price
regularPrice
salePrice
image {
node {
id
sourceUrl
altText
}
attributes {
nodes {
databaseId
name
description
type
onSale
price
regularPrice
salePrice
image {
id
attributeId
name
value
sourceUrl
altText
}
attributes {
nodes {
id
attributeId
name
value
}
}
}
}

quantity
total
subtotal
Expand All @@ -57,23 +63,34 @@ mutation($input: UpdateItemQuantitiesInput!) {
removed {
key
product {
id
databaseId
node {
id
databaseId
}
}

variation {
id
databaseId
node {
id
databaseId
}
}
}

updated {
key
product {
id
databaseId
node {
id
databaseId
}
}

variation {
id
databaseId
node {
id
databaseId
}
}
}
}
Expand Down
96 changes: 41 additions & 55 deletions apollo/queries/GET_CART_QUERY.gql
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,58 @@
nodes {
key
product {
id
databaseId
name
description
type
onSale
slug
averageRating
reviewCount
image {
node {
id
sourceUrl
srcSet
altText
title
}
galleryImages {
nodes {
databaseId
name
description
type
onSale
slug
averageRating
reviewCount
image {
id
sourceUrl
srcSet
altText
title
}
galleryImages {
nodes {
id
sourceUrl
srcSet
altText
title
}
}
}
}
variation {
id
databaseId
name
description
type
onSale
price
regularPrice
salePrice
image {
node {
id
sourceUrl
srcSet
altText
title
}
attributes {
nodes {
databaseId
name
description
type
onSale
price
regularPrice
salePrice
image {
id
name
value
sourceUrl
srcSet
altText
title
}
attributes {
nodes {
id
name
value
}
}
}
}
Expand All @@ -61,25 +65,7 @@
subtotalTax
}
}
appliedCoupons {
nodes {
id
databaseId
discountType
amount
dateExpiry
products {
nodes {
id
}
}
productCategories {
nodes {
id
}
}
}
}

subtotal
subtotalTax
shippingTax
Expand Down
2 changes: 1 addition & 1 deletion apollo/queries/GET_PRODUCTS_FROM_CATEGORY_QUERY.gql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
query ProductsFromCategory($id: ID!) {
productCategory(id: $id) {
productCategory(id: $id, idType: ID) {
id
name
products(first: 50) {
Expand Down
4 changes: 2 additions & 2 deletions apollo/queries/GET_SINGLE_PRODUCT_QUERY.gql
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ query Product($id: ID!) {
salePrice
regularPrice
databaseId
paColors {
allPaColors {
nodes {
name
}
}
paSizes {
allPaSizes {
nodes {
name
}
Expand Down
2 changes: 1 addition & 1 deletion components/Cart/CartContents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<div class="item">
<span class="block mt-2 font-extrabold">Name: <br /></span>
<span class="item-content">{{ products.product.name }}</span>
<span class="item-content">{{ products.product.node.name }}</span>
</div>
<div class="item">
<span class="block mt-2 font-extrabold">Quantity: <br /> </span>
Expand Down
Loading