usebruno/bruno · error · Error
Failed to parse GraphQL variables: ${err.message}
Error message
Failed to parse GraphQL variables: ${err.message} What it means
Error "Failed to parse GraphQL variables: ${err.message}" thrown in usebruno/bruno.
Source
Thrown at packages/bruno-electron/src/ipc/network/index.js:636
if (!hasExplicitScheme(request.url)) {
// The scheme must be present before encoding. Without a `://`, encodeUrl
// treats a `host:port` authority as a path segment and percent-encodes the
// port colon (localhost:6000 → localhost%3A6000), which then resolves to a
// bogus host once configureRequest prepends http://.
request.url = `http://${request.url}`;
}
if (request.settings?.encodeUrl) {
request.url = encodeUrl(request.url);
}
// if this is a graphql request, parse the variables, only after interpolation
// https://github.com/usebruno/bruno/issues/884
if (request.mode === 'graphql' && typeof request.data?.variables === 'string') {
try {
request.data.variables = JSON.parse(request.data.variables);
} catch (err) {
throw new Error(`Failed to parse GraphQL variables: ${err.message}`);
}
}
// stringify the request url encoded params
const contentTypeHeader = Object.keys(request.headers).find((name) => name.toLowerCase() === 'content-type');
if (contentTypeHeader && request.headers[contentTypeHeader] === 'application/x-www-form-urlencoded') {
if (Array.isArray(request.data)) {
request.data = buildFormUrlEncodedPayload(request.data);
} else if (typeof request.data !== 'string') {
request.data = qs.stringify(request.data, { arrayFormat: 'repeat' });
}
// if `data` is of string type - return as-is (assumes already encoded)
}
const contentType = contentTypeHeader ? request.headers[contentTypeHeader] : '';
if (typeof contentType === 'string' && contentType.startsWith('multipart/')) {
if (typeof request.data !== 'string' && !isFormData(request.data)) {View on GitHub (pinned to 9bdd81c7bd)
Solutions
- Fix the GraphQL variables so they are valid JSON.
- Check the reported parser error for the exact position.
When it happens
Trigger: Thrown at packages/bruno-electron/src/ipc/network/index.js:636 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13).
Data as JSON: /api/errors/b0bf4e6d3f17c2ee.
Report an issue: GitHub.