Convert JSON to GraphQL Mutation Format

If you want to insert data in your GraphQL Api endpoint using mutation, you can use JS code to convert JSON object into GraphQL Mutation format.

You can get JSON Object / Stringify JSON either from LOOKUP or FormRepeat or any other control or data sources. Now, this JSON format is incompatible for your GraphQL mutation query which expects key name with double quotes. You can use below JS code for converting it in required format -

output = JSON.stringify(SheetData).replace(/"([^"]+)":/g, '$1:')

JS code with proper error hanndling use below code -

if (typeof SheetData == "object") {
    SheetData = JSON.stringify(SheetData);
} else if (typeof SheetData == "string") {
    try {
        SheetData = JSON.stringify(JSON.parse(SheetData));
    } catch (ex) {
        SheetData = "";
    }
}
output = SheetData.replace(/"([^"]+)":/g, '$1:')

Screenshot below with Simple JS handling -