graphql #81

Merged
werewolfkid merged 7 commits from graphql into main 2025-12-06 22:32:59 -05:00
2 changed files with 8 additions and 4 deletions
Showing only changes of commit a0107eeb27 - Show all commits

View File

@@ -9,3 +9,4 @@ SERVER_PORT=3000
BOT_ADMINS=[1] BOT_ADMINS=[1]
GROUP_IDS=- GROUP_IDS=-
GRAPHQL_URL=http://localhost:3000/api/graphql GRAPHQL_URL=http://localhost:3000/api/graphql
API_TOKEN="token-here"

View File

@@ -2,9 +2,12 @@ import { Client, cacheExchange, fetchExchange } from "@urql/core";
const urql = new Client({ const urql = new Client({
url: process.env.GRAPHQL_URL || "", url: process.env.GRAPHQL_URL || "",
exchanges: [cacheExchange, fetchExchange] exchanges: [cacheExchange, fetchExchange],
fetchOptions: {
headers: {
"x-api-key": process.env?.API_TOKEN || ""
}
}
}); });
console.log(`GRAPHQL_URL`, process.env.GRAPHQL_URL);
export default urql; export default urql;