Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Internal Server Error when using ProductCreate Mutation

Solved

Internal Server Error when using ProductCreate Mutation

Marko9812
Shopify Partner
2 1 0

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"
      }
    }
  ]
}

 

 

  

Accepted Solution (1)

Marko9812
Shopify Partner
2 1 0

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.

View solution in original post

Reply 1 (1)

Marko9812
Shopify Partner
2 1 0

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.