tracksinventory in grapgql

xapogo
Tourist
9 2 3

Good morning.

I'm creating products with graphql but a need to make true tracksinventory.

with productcreate, i try to insert tracksinventory but it's no possible so i try with productupdate: InputObject 'ProductInput' doesn't accept argument 'tracksinventory'"

So, any one could tell me how i can activate this field please?

 

Thks

Reply 1 (1)

awwdam
Shopify Staff
249 42 36

Hey @xapogo

If you are looking for 'inventory' fields mentioned, these can be found on the InventoryItem object:
InventoryItem.tracked(GraphQL), InventoryItem.trackedEditable (GraphQL)

There is a short introduction to this object in the REST docs that explains a bit more about how InventoryItem works: 

"There is a 1:1 relationship between a product variant and an inventory item. Each product variant includes the ID of its related inventory item."

To utilize these APIs you will also need to update an application's access scopes to include: read_inventorywrite_inventoryClick here for the GraphQL documentation that provides a more detailed overview of all objects, queries, and mutations related to the functionality mentioned in your post.

Hope that offer a good starting point - Best!


awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog