Skip to content

Commit 4c5bd7b

Browse files
committed
feat: address breaking api changes when upgrading to 2024-07
1 parent a862a4c commit 4c5bd7b

5 files changed

Lines changed: 25 additions & 9 deletions

File tree

packages/gatsby-source-shopify/src/plugin-options-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function pluginOptionsSchema({ Joi }: PluginOptionsSchemaArgs): unknown {
4343
`Not set by default. If set to a string (example \`MyStore\`) node names will be \`allMyStoreShopifyProducts\` instead of \`allShopifyProducts\``
4444
),
4545
apiVersion: Joi.string()
46-
.default(`2024-04`)
46+
.default(`2024-07`)
4747
.description(
4848
`The API version that should be used. More information: https://shopify.dev/docs/api/usage/versioning`
4949
),

packages/gatsby-source-shopify/src/query-builders/locations-query.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export class LocationsQuery extends BulkQuery {
4949
handle
5050
id
5151
inventoryManagement
52-
productBased
5352
serviceName
5453
shippingMethods {
5554
code

packages/gatsby-source-shopify/src/query-builders/product-variants-query.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ export class ProductVariantsQuery extends BulkQuery {
6363
count
6464
precision
6565
}
66+
measurement {
67+
weight {
68+
unit
69+
value
70+
}
71+
}
6672
provinceCodeOfOrigin
6773
requiresShipping
6874
sku
@@ -112,7 +118,6 @@ export class ProductVariantsQuery extends BulkQuery {
112118
product {
113119
id
114120
}
115-
requiresShipping
116121
selectedOptions {
117122
name
118123
value
@@ -127,8 +132,6 @@ export class ProductVariantsQuery extends BulkQuery {
127132
taxable
128133
title
129134
updatedAt
130-
weight
131-
weightUnit
132135
metafields {
133136
edges {
134137
node {

packages/gatsby-source-shopify/src/type-builders/location-type.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export function locationTypeBuilder(prefix: string): string {
55
fulfillmentOrdersOptIn: Boolean!
66
handle: String!
77
inventoryManagement: Boolean!
8-
productBased: Boolean! @deprecated(reason: "\`productBased\` will be removed in version 2024-07, non-product based fulfillment services are no longer supported")
98
serviceName: String!
109
shippingMethods: [${prefix}ShippingMethod!]!
1110
shopifyId: String!
@@ -27,6 +26,7 @@ export function locationTypeBuilder(prefix: string): string {
2726
inventoryLevels: [${prefix}InventoryLevel!]! @link(by: "id") @proxy(from: "inventoryLevels___NODE", fromNode: true)
2827
legacyResourceId: String!
2928
locationsCount: Int! @proxy(from: "locationsCount.count")
29+
measurement: ${prefix}InventoryItemMeasurement
3030
provinceCodeOfOrigin: String
3131
requiresShipping: Boolean!
3232
shopifyId: String!
@@ -38,6 +38,11 @@ export function locationTypeBuilder(prefix: string): string {
3838
variant: ${prefix}ProductVariantConnection!
3939
}
4040
41+
type ${prefix}InventoryItemMeasurement {
42+
id: ID!
43+
weight: ${prefix}Weight
44+
}
45+
4146
type ${prefix}InventoryQuantity {
4247
name: String!
4348
quantity: Int!
@@ -97,6 +102,18 @@ export function locationTypeBuilder(prefix: string): string {
97102
label: String!
98103
}
99104
105+
type ${prefix}Weight {
106+
unit: ${prefix}WeightUnit!
107+
value: Float!
108+
}
109+
110+
enum ${prefix}WeightUnit {
111+
GRAMS
112+
KILOGRAMS
113+
OUNCES
114+
POUNDS
115+
}
116+
100117
extend type ${prefix}ProductVariant {
101118
inventoryItem: ${prefix}InventoryItem!
102119
}

packages/gatsby-source-shopify/src/type-builders/product-variant-type.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export function productVariantTypeBuilder(prefix: string): string {
1919
presentmentPrices: [${prefix}ProductVariantPricePair!]!
2020
price: Float!
2121
product: ${prefix}Product! @link(from: "_product", by: "id")
22-
requiresShipping: Boolean! @deprecated(reason: "Use \`InventoryItem.requiresShipping\` instead.")
2322
selectedOptions: [${prefix}SelectedOption!]!
2423
sellingPlanGroupCount: Int! @proxy(from: "sellingPlanGroupsCount.count")
2524
shopifyId: String!
@@ -29,8 +28,6 @@ export function productVariantTypeBuilder(prefix: string): string {
2928
taxCode: String
3029
title: String!
3130
updatedAt: Date! @dateformat
32-
weight: Float
33-
weightUnit: ${prefix}WeightUnit!
3431
}
3532
3633
enum ${prefix}ProductVariantInventoryPolicy {

0 commit comments

Comments
 (0)