// Generated by ReScript, PLEASE EDIT WITH CARE function decode(data) { let match = JSON.parse(data); if (typeof match !== "object" || match === null || Array.isArray(match)) { return []; } let match$1 = match.type; if (typeof match$1 !== "string") { return []; } switch (match$1) { case "a" : return ["A"]; case "b" : return ["B"]; case "c" : return ["C"]; case "d" : return ["D"]; case "e" : return ["E"]; case "f" : return ["F"]; default: return []; } } function decodePayload(data) { let match = JSON.parse(data); if (typeof match !== "object" || match === null || Array.isArray(match)) { return 0; } let match$1 = match.operationName; let exit = 0; if (typeof match$1 === "string") { let exit$1 = 0; let tmp = match.query; if (typeof tmp === "string") { let exit$2 = 0; let tmp$1 = match.documentId; if (typeof tmp$1 === "string") { let tmp$2 = match.variables; if (typeof tmp$2 === "object" && tmp$2 !== null && !Array.isArray(tmp$2)) { return 4; } else { return 3; } } exit$2 = 4; if (exit$2 === 4) { let tmp$3 = match.variables; if (typeof tmp$3 === "object" && tmp$3 !== null && !Array.isArray(tmp$3)) { return 3; } } } else { exit$1 = 3; } if (exit$1 === 3) { let tmp$4 = match.documentId; if (typeof tmp$4 === "string") { let tmp$5 = match.variables; if (typeof tmp$5 === "object" && tmp$5 !== null && !Array.isArray(tmp$5)) { return 3; } } } } else { exit = 2; } if (exit === 2) { let tmp$6 = match.query; if (typeof tmp$6 === "string") { let tmp$7 = match.documentId; if (typeof tmp$7 === "string") { let tmp$8 = match.variables; if (typeof tmp$8 === "object" && tmp$8 !== null && !Array.isArray(tmp$8)) { return 3; } } } } if (typeof match$1 !== "string") { return 0; } let tmp$9 = match.query; if (typeof tmp$9 === "string") { return 2; } else { return 1; } } export { decode, decodePayload, } /* No side effect */