GraphQL node error handling hardened against non-standard responses
The GraphQL node no longer crashes when an API returns error responses in unexpected formats. A string error payload that previously caused a TypeError now gets handled gracefully.
When a GraphQL API returns an error response where the errors field contains a plain string instead of an array of objects, the n8n GraphQL node would crash with a TypeError. The code tried to call .map() on the string, which doesn't exist as a method. This affected integrations like the Shopify GraphQL API that sometimes return simpler error structures.
The node now inspects the error response type before processing it. Arrays continue to work as before — messages are extracted and joined. Strings are used directly as the error message. When neither format applies, a generic "Unexpected error" message is used as a fallback. Users running workflows that hit APIs with non-standard error formats should see cleaner error messages instead of crashes.
View Original GitHub Description
Summary
<!-- Describe what the PR does and how to test. Photos and videos are recommended. -->If a GraphQL returns an error response where .errors is not an array of objects with message property, it would fail or produce an invalid message. This PR fixes that by handling more error formats with a fallback error message
Related Linear tickets, Github issues, and Community forum posts
<!-- Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to reviewers. https://linear.app/n8n/issue/ --> <!-- Use "closes #<issue-number>", "fixes #<issue-number>", or "resolves #<issue-number>" to automatically close issues when the PR is merged. -->https://linear.app/n8n/issue/NODE-4737/community-issue-graphql-node-issue-parsing-responseerrorsmap-is-not-a Closes #27601
Review / Merge checklist
- PR title and summary are descriptive. (conventions) <!-- **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** -->
- Docs updated or follow-up ticket created.
- Tests included. <!-- A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. -->
- PR Labeled with
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)