# JSON array to GraphQL variable

**URL:** <https://connective.celigo.com/t/json-array-to-graphql-variable/5408>\
**Category:** Integrator.io\
**Tags:** shopify\
**Created:** [September 4, 2025, 8:48pm UTC](https://connective.celigo.com/t/json-array-to-graphql-variable/5408 "2025-09-04T20:48:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![meckens](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@meckens](https://connective.celigo.com/u/meckens)\
**Post date:** [September 4, 2025, 8:48pm UTC](https://connective.celigo.com/t/json-array-to-graphql-variable/5408/1 "2025-09-04T20:48:53Z")

</div>

Hi, I’m struggling with passing a JSON array through to a Shopify GraphQL request.

Example array

```json
{
    "page_of_records": [
        {
            "record": {
                "prefixedShopifyVariantIds": [
                    "gid://shopify/ProductVariant/39828607631446",
                    "gid://shopify/ProductVariant/39828607631447"
                ]
            }
        }
    ]
}

```

In the example below I have put “' ‘ ‘ “ around the handlebars to get a result in the preview.

 ![ShopifyGraphQL](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/7/738709150e7da5f9f098be862a8ee4f7c74081a9.png)

Manually entering the below works, but I can’t seem for it to parse `{{{jsonSerialize record.prefixedShopifyVariantIds}}}`

```json
{
    "ids": [
        "gid://shopify/ProductVariant/39828607631446",
        "gid://shopify/ProductVariant/39828607631447"
    ]
}

```

Can anyone point me in the right direction?

---

<div class="post-metadata">

**Author:** ![tylerlamparter](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tylerlamparter/32/9204_2.png) [@tylerlamparter](https://connective.celigo.com/u/tylerlamparter)\
**Post date:** [September 5, 2025, 1:55am UTC](https://connective.celigo.com/t/json-array-to-graphql-variable/5408/2 "2025-09-05T01:55:09Z")

</div>

Use `{{{jsonSerialize record.prefixedShopifyVariantIds}}}` and then remove the double quotes and single quotes around it.

---

<div class="post-metadata">

**Author:** ![meckens](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@meckens](https://connective.celigo.com/u/meckens)\
**Post date:** [September 11, 2025, 10:59pm UTC](https://connective.celigo.com/t/json-array-to-graphql-variable/5408/3 "2025-09-11T22:59:54Z")

</div>

Thanks @tylerlamparter

Setting the variable like you suggested produces the following error.

```auto
{
"ids":{{{jsonSerialize record.prefixedShopifyVariantIds}}}
}

```

```auto
[
  {
    "code": "handlebars_template_parse_error",
    "message": "Failed to generate request body from template: {\"query\":\"query GetVariants($ids: [ID!]!) {\\r\\n nodes(ids: $ids) {\\r\\n ... on ProductVariant {\\r\\n id\\r\\n inventoryItem {\\r\\n id\\r\\n }\\r\\n }\\r\\n }\\r\\n}\",\"variables\":\"{\\\"ids\\\":{{{jsonSerialize record.prefixedShopifyVariantIds}}}}\"}. Details: Parse error on line 1:\n...xedShopifyVariantIds}}}}\"}\n-----------------------^\nExpecting 'CLOSE_UNESCAPED', 'OPEN_SEXPR', 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'CLOSE_RAW_BLOCK'.",
    "occurredAt": 1757631367699,
    "resolved": false,
    "source": "resource"
  }
]

```

---

<div class="post-metadata">

**Author:** ![tylerlamparter](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tylerlamparter/32/9204_2.png) [@tylerlamparter](https://connective.celigo.com/u/tylerlamparter)\
**Post date:** [September 12, 2025, 12:04am UTC](https://connective.celigo.com/t/json-array-to-graphql-variable/5408/4 "2025-09-12T00:04:37Z")

</div>

Just tested this myself and it is a bug. I've logged it internally, but if you make a support ticket, they can link your ticket to the internal one to automatically get updates on when this is fixed.

---

<div class="post-metadata">

**Author:** ![meckens](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@meckens](https://connective.celigo.com/u/meckens)\
**Post date:** [September 12, 2025, 2:06am UTC](https://connective.celigo.com/t/json-array-to-graphql-variable/5408/5 "2025-09-12T02:06:17Z")

</div>

Thanks @tylerlamparter

---

<div class="post-metadata">

**Author:** ![friendoftuesday](https://avatars.discourse-cdn.com/v4/letter/f/c89c15/32.png) [@friendoftuesday](https://connective.celigo.com/u/friendoftuesday)\
**Post date:** [September 18, 2025, 7:11pm UTC](https://connective.celigo.com/t/json-array-to-graphql-variable/5408/6 "2025-09-18T19:11:15Z")

</div>

Can you try with only two braces and no quotes?

---

<div class="post-metadata">

**Author:** ![tylerlamparter](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tylerlamparter/32/9204_2.png) [@tylerlamparter](https://connective.celigo.com/u/tylerlamparter)\
**Post date:** [October 13, 2025, 2:01pm UTC](https://connective.celigo.com/t/json-array-to-graphql-variable/5408/7 "2025-10-13T14:01:22Z")

</div>

@friendoftuesday just seeing this and confirmed no quotes and only 2 curly braces work.

```handlebars
{"ids": {{jsonSerialize settings.export.ids}} }

```
