Shopify Product Mutation fails unless we add a carriage return

I have a client who is using graphql to create products. They’ve used it before but just moved to using the Jan 2024 api version (though I’ve tested beyond that). When they try to post to create it errors. The fix is they have to add a an extra line in the query before the closing quote on the description (everything else is identical). Anyone ever seen this? Going to dig in more but thought I’d check if there’s something known that would cause it to error.

I tested on my own store with their graphql query and got the exact same.

descriptionHtml: “NICOLAS DE ANGELIS Guitar Guitar” in the query gives:

syntax error, unexpected invalid token ("\"") at [225, 18]

Change it to the below and it works:

descriptionHtml: "NICOLAS DE ANGELIS Guitar Guitar
"
(just adding a carriage return at the end of the line)

Well just a little update. I did some testing (still need more) and found that there’s a metafield in the graphql that has an è character in it. If I remove it, then the graphql processes without the extra carriage return in the description. If I leave the è in, then the extra carriage return in the description is required. Makes no sense to me, seems like a very odd bug. Will be testing more but wanted to post here in case anyone else runs into this.

Thanks for sharing. Agree it seems to be a weird bug, and likely would be a simple/quick fix by just allowing such content. I get it if it’s a security risk but having documentation saying what characters are not allowed would be useful here.

Hi MadWizard - thanks for flagging this, we’re looking into it now!

2 Likes

Hi again folks - just wanted to update that this is confirmed as a bug on our side and our team will action on fixing it.

1 Like