Feature request - Upsert product mutations

The Shopify API needs a product upsert mutation. Especially in bulk mutation context. Think 25.000+ products which needs to be imported, and you don’t know if they already exist in the store, and you can’t really check if, because it would result in many queries.

The productSet mutation is super close, but it needs to be able to set properties based on whether the product exists or not.

Hey @andershagbard, productSet should already handle this.

You can use identifier: { handle: "your-handle" } or identifier: { customId: { namespace: "custom", key: "external_id", value: "12345" } } to match against an existing product. productSet only updates the fields you include in the input and leaves everything else on the product alone.

Although, if you want different behavior on create vs. update (like setting status: DRAFT only for new products), then that is something you’d have to handle in your app logic.

@KyleG-Shopify It can be hard to track which products already exists in a large product database. Therefore it could make sense to add an upsert mutation.

`productSet` is close, but it doesn’t handle different update/insert input.

Thanks for those additional details. I’ve passed on your feedback as a feature request for you :memo: