bring back GraphQL (#1256)

This commit is contained in:
Fathony Luthfillah 2024-05-23 16:00:48 +07:00 committed by GitHub
parent bb9fb130ef
commit 01cd21e489
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 16 deletions

View File

@ -23,6 +23,7 @@ module.exports = {
},
devOptions: {
/* ... */
port: 3001
},
buildOptions: {
/* ... */

View File

@ -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";