MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / wrapGraphQlParams

Function wrapGraphQlParams

scripts/test.js:598–610  ·  view source on GitHub ↗
(params)

Source from the content-addressed store, hash-verified

596 }
597
598 function wrapGraphQlParams(params) {
599 const formBody = [];
600 for (const property in params) {
601 const encodedKey = encodeURIComponent(property);
602 const value =
603 typeof params[property] === "string"
604 ? params[property]
605 : JSON.stringify(params[property]);
606 const encodedValue = encodeURIComponent(value);
607 formBody.push(encodedKey + "=" + encodedValue);
608 }
609 return formBody.join("&");
610 }
611
612 async function fetchGraphQl(params, fb_dtsg = getFbdtsg()) {
613 let form = wrapGraphQlParams({

Callers 1

fetchGraphQlFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected