Skip to content

Commit

Permalink
Add product and variant admin_graphql_api_id attribute (bold-commerce#23
Browse files Browse the repository at this point in the history
)

* Add storefront access token service

* Add product and variant admin_graphql_api_id attribute

Signed-off-by: ChouAndy <[email protected]>
  • Loading branch information
chouandy authored and dbertouille committed Oct 2, 2018
1 parent 05c6702 commit f76f517
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 30 deletions.
8 changes: 5 additions & 3 deletions fixtures/product.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"weight": 0.0,
"weight_unit": "lb",
"old_inventory_quantity": 1,
"requires_shipping": true
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/1070325219"
}
],
"options": [
Expand All @@ -53,6 +54,7 @@
],
"images": [
],
"image": null
"image": null,
"admin_graphql_api_id": "gid://shopify/Product/1071559748"
}
}
}
55 changes: 28 additions & 27 deletions fixtures/variant.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
{
"variant": {
"id": 1,
"product_id": 1,
"title": "Yellow",
"price": "1.00",
"sku": "",
"position": 2,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": null,
"inventory_item_id": 1,
"option1": "Yellow",
"option2": null,
"option3": null,
"created_at": "2017-10-18T12:22:36-04:00",
"updated_at": "2017-10-18T12:22:36-04:00",
"taxable": true,
"barcode": null,
"grams": 0,
"image_id": null,
"inventory_quantity": 1,
"weight": 0,
"weight_unit": "lb",
"old_inventory_quantity": 1,
"requires_shipping": true
}
"variant": {
"id": 1,
"product_id": 1,
"title": "Yellow",
"price": "1.00",
"sku": "",
"position": 2,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": null,
"inventory_item_id": 1,
"option1": "Yellow",
"option2": null,
"option3": null,
"created_at": "2017-10-18T12:22:36-04:00",
"updated_at": "2017-10-18T12:22:36-04:00",
"taxable": true,
"barcode": null,
"grams": 0,
"image_id": null,
"inventory_quantity": 1,
"weight": 0,
"weight_unit": "lb",
"old_inventory_quantity": 1,
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/1"
}
}
1 change: 1 addition & 0 deletions product.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type Product struct {
MetafieldsGlobalTitleTag string `json:"metafields_global_title_tag,omitempty"`
MetafieldsGlobalDescriptionTag string `json:"metafields_global_description_tag,omitempty"`
Metafields []Metafield `json:"metafields,omitempty"`
AdminGraphqlAPIID string `json:"admin_graphql_api_id,omitempty"`
}

// The options provided by Shopify
Expand Down
1 change: 1 addition & 0 deletions variant.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type Variant struct {
WeightUnit string `json:"weight_unit,omitempty"`
OldInventoryQuantity int `json:"old_inventory_quantity,omitempty"`
RequireShipping bool `json:"requires_shipping,omitempty"`
AdminGraphqlAPIID string `json:"admin_graphql_api_id,omitempty"`
}

// VariantResource represents the result from the variants/X.json endpoint
Expand Down

0 comments on commit f76f517

Please sign in to comment.