Skip to content

Commit

Permalink
bring back GraphQL (#1256)
Browse files Browse the repository at this point in the history
  • Loading branch information
x2nie authored May 23, 2024
1 parent bb9fb13 commit 01cd21e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions packages/webamp-modern/snowpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {
},
devOptions: {
/* ... */
port: 3001
},
buildOptions: {
/* ... */
Expand Down
32 changes: 16 additions & 16 deletions packages/webamp-modern/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,22 @@ async function initializeSkinListMenu() {
`;

let bankskin1 = [];
// try {
// const response = await fetch("https://api.webampskins.org/graphql", {
// method: "POST",
// headers: {
// "Content-Type": "application/json",
// Accept: "application/json",
// },
// mode: "cors",
// credentials: "include",
// body: JSON.stringify({ query, variables: {} }),
// });
// const data = await response.json();
// bankskin1 = data.data.modern_skins.nodes;
// } catch (e) {
// console.warn('faile to load skins from api.webampskins.org')
// }
try {
const response = await fetch("https://api.webampskins.org/graphql", {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
mode: "cors",
credentials: "include",
body: JSON.stringify({ query, variables: {} }),
});
const data = await response.json();
bankskin1 = data.data.modern_skins.nodes;
} catch (e) {
console.warn('faile to load skins from api.webampskins.org')
}

const select = document.createElement("select");
select.style.position = "absolute";
Expand Down

0 comments on commit 01cd21e

Please sign in to comment.