Skip to content

fix(graphqlTS): surface real error detail instead of a generic schema error - #199

Merged
naman-contentstack merged 2 commits into
developmentfrom
fix/DX-10294
Aug 28, 2026
Merged

fix(graphqlTS): surface real error detail instead of a generic schema error#199
naman-contentstack merged 2 commits into
developmentfrom
fix/DX-10294

Conversation

@naman-contentstack

Copy link
Copy Markdown
Contributor

Non-schema GraphQL failures (plain HTTP errors, top-level GraphQL errors, REST-style error_message bodies) were collapsing into the generic GRAPHQL_SCHEMA_ERROR because only one specific error shape was checked. Falls back through the other known shapes, then to HTTP status + request URL, so callers get something to diagnose.

Recreated against the new development branch (old development/main history was out of sync — development was recreated from main and this is a fresh commit, replacing closed PR #198).

Test plan

  • tests/unit/graphqlTS/graphqlTS.test.ts — 10/10 passing, including 3 new regression cases

… error

Non-schema GraphQL failures (plain HTTP errors, top-level GraphQL
errors, REST-style error_message bodies) were collapsing into the
generic GRAPHQL_SCHEMA_ERROR because only one specific error shape was
checked. Fall back through the other known shapes, then to the HTTP
status and request URL, so callers get something to diagnose.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@naman-contentstack
naman-contentstack requested a review from a team as a code owner August 28, 2026 10:56
@snyk-io

snyk-io Bot commented Aug 28, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Coverage report for commit: fe245c8
File: coverage/clover.xml

Cover ┌─────────────────────────┐ Freq.
   0% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  10% │ █░░░░░░░░░░░░░░░░░░░░░░ │  3.1%
  20% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  30% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  40% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  50% │ █░░░░░░░░░░░░░░░░░░░░░░ │  3.1%
  60% │ █░░░░░░░░░░░░░░░░░░░░░░ │  3.1%
  70% │ █░░░░░░░░░░░░░░░░░░░░░░ │  3.1%
  80% │ ███░░░░░░░░░░░░░░░░░░░░ │  9.4%
  90% │ ██░░░░░░░░░░░░░░░░░░░░░ │  6.3%
 100% │ ███████████████████████ │ 71.9%
      └─────────────────────────┘
 *Legend:* █ = Current Distribution 
Summary - Lines: 79.29% | Methods: 75.89% | Branches: 61.76%
FilesLinesMethodsBranches
src/constants
   index.ts100.00%33.33%100.00%
   messages.ts64.29%54.55%50.00%
src/format
   index.ts100.00%100.00%100.00%
src/generateTS/docgen
   jsdoc.ts100.00%100.00%75.00%
   nulldoc.ts100.00%100.00%100.00%
src/generateTS
   factory.ts81.93%94.87%60.24%
   index.ts80.39%58.33%65.06%
src/generateTS/shared
   cslp-helpers.ts66.67%50.00%100.00%
   utils.ts88.68%88.24%22.73%
src/generateTS/stack
   builtins.ts80.00%100.00%18.18%
src/graphqlTS
   index.ts94.74%50.00%82.09%
   queries.ts100.00%100.00%100.00%
src/logger
   index.ts51.35%53.33%37.50%
src/sdk
   utils.ts11.54%--
tests/unit
   mock.ts100.00%100.00%100.00%
tests/unit/tsgen
   boolean.ct.js100.00%100.00%100.00%
   custom-field.ct.js100.00%100.00%100.00%
   defaults.ct.js100.00%100.00%100.00%
   global.fields.ct.js100.00%100.00%100.00%
   group.ct.js100.00%100.00%100.00%
   initialization.ct.js100.00%100.00%100.00%
   isodate.ct.js100.00%100.00%100.00%
   jsdoc.ct.js100.00%100.00%100.00%
   json-rte.ct.js100.00%100.00%100.00%
   modular.blocks.ct.js100.00%100.00%100.00%
   number.ct.js100.00%100.00%100.00%
   numeric-keys.ct.js100.00%100.00%100.00%
   options.ct.js100.00%100.00%100.00%
   references.ct.js100.00%100.00%100.00%
   select.ct.js100.00%100.00%100.00%
   string.ct.js100.00%100.00%100.00%
   taxonomies.ct.js100.00%100.00%100.00%

🤖 comment via lucassabreu/comment-coverage-clover

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@naman-contentstack
naman-contentstack merged commit d4a94c3 into development Aug 28, 2026
9 checks passed
@naman-contentstack
naman-contentstack deleted the fix/DX-10294 branch August 28, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants