App reviews, troubleshooting, and recommendations
In the GraphQL Admin API, when I execute a query with an id in productCreate, the specified ID is not registered, but the ID numbered by shopify is registered.
The specified ID is the id of the ProductInput, the id of the ProductVariant, and
The API version is 2021-10.
The following is the query that I ran.
The id values are set so that there are no duplicates.
What was wrong with it?
mutation {
productCreate( input:
{
id:"gid://shopify/Product/7103618613439",
title: "test product"
variants:
[{
id: "gid://shopify/ProductVariant/41047365222586"
title: "test variant"
}]
}
) {
product {
id
variants(first:1) {
edges {
node {
id
}
}
}
} userErrors {
message
}
}
}
Here is the result
{
"data": {
"productCreate": {
"product": {
"id": "gid://shopify/Product/7113547645118",
"variants": {
"edges": [
{
"node": {
"id": "gid://shopify/ProductVariant/41078505144510"
}
}
]
}
},
"userErrors": []
}
}
}
You can't set the ID of your objects. IDs are unique across the platform, not just to the one shop so it's something that Shopify will continue to be the master record owner of.
If you need to set an ID perhaps you could look at storing that value somewhere else for cross referencing.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025