You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the Variables (or Headers) pane contains malformed JSON, run() in @graphiql/react parses it client-side, writes an error into the response pane, and returns without sending a request:
It looks like a server response. The error is rendered in the same { errors: [...] } shape and place as a real response, with no indication that no request was made.
The message is not user-friendly.ValueExpected is the bare jsonc-parser enum name; a plain-language description and a line/column would help, and jsonc-parser already reports offset and length for each error.
There is no way to change it. No prop or callback covers this, ExecuteButton is not replaceable, and no plugin hook runs before run(). Workarounds require aliasing or patching internal module paths.
Related
Apollo Sandbox parses variables client-side too, but strips the invalid content, shows a toast ("Invalid content in variables… was stripped from the request"), and forwards the request so the server's own message is what appears in the response pane.
Problem
When the Variables (or Headers) pane contains malformed JSON,
run()in@graphiql/reactparses it client-side, writes an error into the response pane, and returns without sending a request:{ "errors": [ { "message": "Variables are invalid JSON: ValueExpected." } ] }Source:
stores/execution.ts(tryParseJSONC→setError→return) andutility/jsonc.ts.Three issues with this:
{ errors: [...] }shape and place as a real response, with no indication that no request was made.ValueExpectedis the barejsonc-parserenum name; a plain-language description and a line/column would help, andjsonc-parseralready reportsoffsetandlengthfor each error.ExecuteButtonis not replaceable, and no plugin hook runs beforerun(). Workarounds require aliasing or patching internal module paths.Related
variablesplugin type but nothing scheduled.Environment
graphiql5.2.2,@graphiql/react0.37.3,jsonc-parser3.3.1mainas of 2026-09-11Repro
query Q($id: Int!) { node(id: $id) { id } }{"id": }errorsblock above in the response pane and no network request.