Skip to content

fix(graphql-server): return HTTP 413 for oversized JSON - #1972

Open
yyyyaaa wants to merge 1 commit into
mainfrom
fix/payload-too-large-413
Open

yyyyaaa wants to merge 1 commit into
mainfrom
fix/payload-too-large-413

Conversation

@yyyyaaa

@yyyyaaa yyyyaaa commented Nov 6, 2026

Copy link
Copy Markdown
Contributor
  • Return HTTP 413 for oversized JSON and HTTP 400 for malformed JSON so callers can distinguish a rejected request from a server failure.
  • Include the parser's 102,400-byte limit in the GraphQL error and keep the existing REST error format.
  • Log parser failures at warning level without echoing request fragments.

@tenki-reviewer

tenki-reviewer Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Review complete. No issues found — approved ✅.


This PR updates the error-handler middleware in the graphql/server package, adjusting how errors are mapped to HTTP statuses and which response envelope (GraphQL, REST JSON, or error page) is used, along with the associated logging behavior. No high-confidence defects were identified in the final review.

Files Change
graphql/server/src/middleware/error-handler.ts Reworks error-handling middleware: status-code mapping, response-envelope selection, and error logging.
graphql/server/src/middleware/__tests__/error-handler.test.ts Expands unit tests covering the updated error-handler behavior.

Reviewed commit: e0264d1

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.

1 participant