# Issues with GraphQL Node

**URL:** <https://community.n8n.io/t/issues-with-graphql-node/51382>\
**Category:** Questions\
**Tags:** shopify, graphql\
**Created:** [August 7, 2024, 4:26pm UTC](https://community.n8n.io/t/issues-with-graphql-node/51382 "2024-08-07T16:26:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Vainer](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ben_vainer/32/42715_2.png) [@Ben\_Vainer](https://community.n8n.io/u/Ben_Vainer)\
**Post date:** [August 7, 2024, 4:26pm UTC](https://community.n8n.io/t/issues-with-graphql-node/51382/1 "2024-08-07T16:26:06Z")

</div>

## Describe the problem/error/question

I am trying to use the Graphql node to send queries/mutations to shopify but keep getting errors. I have even tried copying exactly from n8n templates, but keep getting the error message.

## What is the error message (if any)?

TypeError: \_a.map is not a function at Object.execute (/usr/local/lib/node\_modules/n8n/node\_modules/n8n-nodes-base/dist/nodes/GraphQL/GraphQL.node.js:462:101) at processTicksAndRejections (node:internal/process/task\_queues:95:5) at Workflow.runNode (/usr/local/lib/node\_modules/n8n/node\_modules/n8n-workflow/dist/Workflow.js:725:19) at /usr/local/lib/node\_modules/n8n/node\_modules/n8n-core/dist/WorkflowExecute.js:673:51 at /usr/local/lib/node\_modules/n8n/node\_modules/n8n-core/dist/WorkflowExecute.js:1085:20

## Please share your workflow

## Information on your n8n setup

- **n8n version:**  
I have tried the node both on a cloud hosted version of the software, and on my own self hosted version. The self hosted version uses all default settings and is hosted on Digital Ocean.

I get the same error on both instances.

---

<div class="post-metadata">

**Author:** ![n8n](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/n8n/32/196425_2.png) [@n8n](https://community.n8n.io/u/n8n)\
**Post date:** [August 7, 2024, 4:26pm UTC](https://community.n8n.io/t/issues-with-graphql-node/51382/2 "2024-08-07T16:26:08Z")

</div>

It looks like your topic is missing some important information. Could you provide the following if applicable.

- **n8n version:**
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**
- **Operating system:**

---

<div class="post-metadata">

**Author:** ![aya](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/aya/32/194036_2.png) [@aya](https://community.n8n.io/u/aya)\
**Post date:** [August 9, 2024, 2:02pm UTC](https://community.n8n.io/t/issues-with-graphql-node/51382/3 "2024-08-09T14:02:57Z")

</div>

Welcome to the community @Ben_Vainer 🎉  
I think the error you’re seeing occurs when you try to call `.map()` on something that isn’t an array. Can you try changing the `files` input into an array instead of an object in the variables?

```auto
{
  "files": [
    {
      "alt": "Ben",
      "contentType": "IMAGE",
      "filename": "Ben",
      "originalSource": "https://teecommercecabot.myshopify.com/cdn/shop/files/CH_Spire_180x180_4824f432-59d0-4010-8826-e39b637c2eb1_110x.png?v=1721942398"
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![john-md86](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/john-md86/32/47064_2.png) [@john-md86](https://community.n8n.io/u/john-md86)\
**Post date:** [October 22, 2024, 6:54pm UTC](https://community.n8n.io/t/issues-with-graphql-node/51382/4 "2024-10-22T18:54:47Z")

</div>

```auto
{
  products(first: 5) {
    edges {
      node {
        id
      }
    }
  }
}

```

response.errors?.map is not a function

---

<div class="post-metadata">

**Author:** ![robocrax](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/robocrax/32/47610_2.png) [@robocrax](https://community.n8n.io/u/robocrax)\
**Post date:** [November 1, 2024, 7:28am UTC](https://community.n8n.io/t/issues-with-graphql-node/51382/5 "2024-11-01T07:28:12Z")

</div>

n8n version

`1.64.3 (Self Hosted)`

Stack trace

```auto
TypeError: response.errors?.map is not a function at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/GraphQL/GraphQL.node.js:461:54) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:722:19) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:711:51 at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1141:20

```

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/f/f/ffd9b39cbf645b714d4e13643570c6c9bee89247.png)

---

<div class="post-metadata">

**Author:** ![robocrax](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/robocrax/32/47610_2.png) [@robocrax](https://community.n8n.io/u/robocrax)\
**Post date:** [November 1, 2024, 7:28am UTC](https://community.n8n.io/t/issues-with-graphql-node/51382/6 "2024-11-01T07:28:14Z")

</div>

![image](https://europe1.discourse-cdn.com/n8n/original/3X/4/2/424947c446c7f0444545eef6088b748074826acd.png)

Yupp, getting the same error when running function and this error shows up when building the query

```auto
Unexpected token 'q', "query {
  "... is not valid JSON"`

```

even while using the exact same query as mentioned in their examples [API queries data from GraphQL | n8n workflow template](https://n8n.io/workflows/216-api-queries-data-from-graphql/)

Changing the response format to string has a different outcome but doesn’t solve the issue

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/1/1/11d6686a33eb3b86180032306dc01c9c1549f729.png)

---

<div class="post-metadata">

**Author:** ![RuentDev](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ruentdev/32/47054_2.png) [@RuentDev](https://community.n8n.io/u/RuentDev)\
**Post date:** [November 8, 2024, 2:33pm UTC](https://community.n8n.io/t/issues-with-graphql-node/51382/7 "2024-11-08T14:33:15Z")

</div>

Encounter same error, in my case it happen when I am trying to use Shopify Admin API , but it works fine using storefront api, but I need to update my product variants I really need to use Shopify Admin API, is there anyone finds a workaround to this issue ?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [February 6, 2025, 2:34pm UTC](https://community.n8n.io/t/issues-with-graphql-node/51382/8 "2025-02-06T14:34:06Z")

</div>

Closed on February 6, 2025, 2:34pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
