fix: interpolate json body for type object -- graphql variables (#3212)

This commit is contained in:
lohit 2024-09-30 17:14:58 +05:30 committed by GitHub
parent d448599a53
commit e2baed6724
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,6 +68,12 @@ const interpolateVars = (request, envVariables = {}, runtimeVariables = {}, proc
if (request.data.length) {
request.data = _interpolate(request.data);
}
} else if (typeof request.data === 'object') {
try {
let parsed = JSON.stringify(request.data);
parsed = _interpolate(parsed);
request.data = JSON.parse(parsed);
} catch (err) {}
}
} else if (contentType === 'application/x-www-form-urlencoded') {
if (typeof request.data === 'object') {