Skip to content

Commit

Permalink
fix: minimize breaking changes by keeping Int type for count fields
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh committed Dec 18, 2024
1 parent cacc12e commit ab17f2e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function collectionTypeBuilder(prefix: string): string {
metafield(namespace: String! key: String!): ${prefix}Metafield
metafields: [${prefix}Metafield!]! @link(from: "metafields___NODE", by: "id")
products: [${prefix}Product!]! @link(from: "products___NODE", by: "id")
productsCount: ${prefix}Count!
productsCount: Int! @proxy(from: "productsCount.count")
ruleSet: ${prefix}CollectionRuleSet
seo: ${prefix}SEO!
shopifyId: String!
Expand Down
10 changes: 0 additions & 10 deletions packages/gatsby-source-shopify/src/type-builders/common-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,15 +511,5 @@ export function commonTypeBuilder(prefix: string): string {
POUNDS
OUNCES
}
enum ${prefix}CountPrecision {
EXACT
AT_LEAST
}
type ${prefix}Count {
count: Int!
precision: ${prefix}CountPrecision!
}
`
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function locationTypeBuilder(prefix: string): string {
inventoryHistoryUrl: String
inventoryLevels: [${prefix}InventoryLevel!]! @link(by: "id") @proxy(from: "inventoryLevels___NODE", fromNode: true)
legacyResourceId: String!
locationsCount: ${prefix}Count!
locationsCount: Int! @proxy(from: "locationsCount.count")
provinceCodeOfOrigin: String
requiresShipping: Boolean!
shopifyId: String!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function productTypeBuilder(prefix: string): string {
isGiftCard: Boolean!
legacyResourceId: String!
media: [${prefix}Media!]! @link(from: "media___NODE", by: "id")
mediaCount: ${prefix}Count!
mediaCount: Int! @proxy(from: "mediaCount.count")
metafield(namespace: String! key: String!): ${prefix}Metafield
metafields: [${prefix}Metafield!]! @link(from: "metafields___NODE", by: "id")
onlineStorePreviewUrl: String
Expand All @@ -27,7 +27,7 @@ export function productTypeBuilder(prefix: string): string {
productType: String!
publishedAt: Date @dateformat
requiresSellingPlan: Boolean!
sellingPlanGroupsCount: ${prefix}Count!
sellingPlanGroupCount: Int! @proxy(from: "sellingPlanGroupsCount.count")
seo: ${prefix}SEO!
shopifyId: String!
status: ${prefix}ProductStatus!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function productVariantTypeBuilder(prefix: string): string {
product: ${prefix}Product! @link(from: "_product", by: "id")
requiresShipping: Boolean! @deprecated(reason: "Use \`InventoryItem.requiresShipping\` instead.")
selectedOptions: [${prefix}SelectedOption!]!
sellingPlanGroupsCount: ${prefix}Count!
sellingPlanGroupCount: Int! @proxy(from: "sellingPlanGroupsCount.count")
sku: String
shopifyId: String!
storefrontId: String!
Expand Down

0 comments on commit ab17f2e

Please sign in to comment.