Discuss all the new features introduced with the new product model in GraphQL.
I created a new development store with the Extended Variants Developer Preview then immediately tried to use the Shopify GraphQL App to do a ProductCreate Mutation following the sample on https://shopify.dev/docs/api/admin-graphql/2024-04/mutations/productCreate#examples-Create_a_product... and received the following internal server error:
API Version: 2024-04
GraphQL: ProductCreate Mutation
Mutation:
mutation CreateProductWithOptions($input: ProductInput!) {
productCreate(input: $input) {
userErrors {
field
message
}
product {
id
options {
id
name
position
values
optionValues {
id
name
hasVariants
}
}
variants(first: 5) {
nodes {
id
title
selectedOptions {
name
value
}
}
}
}
}
}
Variables:
{
"input": {
"title": "New product",
"productOptions": [
{
"name": "Color",
"values": [
{
"name": "Red"
},
{
"name": "Green"
}
]
},
{
"name": "Size",
"values": [
{
"name": "Small"
},
{
"name": "Medium"
}
]
}
]
}
}
Results: I removed the request ID from the results incase its sensitive
{
"errors": [
{
"message": "Internal error. Looks like something went wrong on our end.\nRequest ID: REQUEST-ID-REMOVED-FOR-THIS-POST (include this in support requests).",
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"requestId": "REQUEST-ID-REMOVED-FOR-THIS-POST"
}
}
]
}
Solved! Go to the solution
This is an accepted solution.
Update: If I try this exact same mutation using the API Version: Unstable than it successfully creates the product with options as expected. This is only a problem on the 2024-04 Release Candidate.
This is an accepted solution.
Update: If I try this exact same mutation using the API Version: Unstable than it successfully creates the product with options as expected. This is only a problem on the 2024-04 Release Candidate.