Last active
September 5, 2025 09:00
-
-
Save danielberndt/1f17f8864532a2a1e9ca3761aac986c2 to your computer and use it in GitHub Desktop.
Revisions
-
danielberndt renamed this gist
Sep 5, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ let subdomain = window.location.host.split(".")[0] let cardQuery = {cardCreatedAt: {op: "gt", value: "2022-10-20"}}; -
danielberndt revised this gist
Oct 24, 2022 . No changes.There are no files selected for viewing
-
danielberndt renamed this gist
Oct 24, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
danielberndt created this gist
Oct 24, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ let subdomain = "MYSUBDOMAIN"; // for e.g. MYSUBDOMAIN.codecks.io let cardQuery = {cardCreatedAt: {op: "gt", value: "2022-10-20"}}; // build up the nested query and define which models and fields we want to receive let query = { _root: [ { account: [ { [`cards(${JSON.stringify(cardQuery)})`]: [ "title", "content", {attachments: [ "title", {file: ["url"]} ]} ], }, ], }, ], }; // pass the query to the api let data = await fetch(`https://api.codecks.io?query=${JSON.stringify(query)}&x-account=${subdomain}`, {credentials: "include"}).then(r => r.json()) console.log(data)