{"record":{"id":"b0bf4e6d3f17c2ee","repo":"usebruno/bruno","slug":"failed-to-parse-graphql-variables-err-message-b0bf4e","errorCode":null,"errorMessage":"Failed to parse GraphQL variables: ${err.message}","messagePattern":"Failed to parse GraphQL variables: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/ipc/network/index.js","lineNumber":636,"sourceCode":"    if (!hasExplicitScheme(request.url)) {\n      // The scheme must be present before encoding. Without a `://`, encodeUrl\n      // treats a `host:port` authority as a path segment and percent-encodes the\n      // port colon (localhost:6000 → localhost%3A6000), which then resolves to a\n      // bogus host once configureRequest prepends http://.\n      request.url = `http://${request.url}`;\n    }\n\n    if (request.settings?.encodeUrl) {\n      request.url = encodeUrl(request.url);\n    }\n\n    // if this is a graphql request, parse the variables, only after interpolation\n    // https://github.com/usebruno/bruno/issues/884\n    if (request.mode === 'graphql' && typeof request.data?.variables === 'string') {\n      try {\n        request.data.variables = JSON.parse(request.data.variables);\n      } catch (err) {\n        throw new Error(`Failed to parse GraphQL variables: ${err.message}`);\n      }\n    }\n\n    // stringify the request url encoded params\n    const contentTypeHeader = Object.keys(request.headers).find((name) => name.toLowerCase() === 'content-type');\n\n    if (contentTypeHeader && request.headers[contentTypeHeader] === 'application/x-www-form-urlencoded') {\n      if (Array.isArray(request.data)) {\n        request.data = buildFormUrlEncodedPayload(request.data);\n      } else if (typeof request.data !== 'string') {\n        request.data = qs.stringify(request.data, { arrayFormat: 'repeat' });\n      }\n      // if `data` is of string type - return as-is (assumes already encoded)\n    }\n\n    const contentType = contentTypeHeader ? request.headers[contentTypeHeader] : '';\n    if (typeof contentType === 'string' && contentType.startsWith('multipart/')) {\n      if (typeof request.data !== 'string' && !isFormData(request.data)) {","sourceCodeStart":618,"sourceCodeEnd":654,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/network/index.js#L618-L654","documentation":"Error \"Failed to parse GraphQL variables: ${err.message}\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-electron/src/ipc/network/index.js:636 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the GraphQL variables so they are valid JSON.","Check the reported parser error for the exact position."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}