fixed env variable not working.
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 5m58s

This commit is contained in:
2025-12-06 23:45:46 -05:00
parent 30546606d7
commit 465fbf96c9
8 changed files with 17 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
import { Composer } from "grammy";
import type { Context } from "#root/bot/context.js";
import { logHandle } from "#root/bot/helpers/logging.js";
import urql from "#root/lib/urql.js";
import { urql } from "#root/main.js";
import increment from "#root/lib/graphql/mutations/incrimentMutation.js";
const composer = new Composer<Context>();

View File

@@ -3,7 +3,7 @@ import type { Context } from "#root/bot/context.js";
import { logHandle } from "#root/bot/helpers/logging.js";
import metaLinkCheck from "#root/lib/metaLinkCheck.js";
import twitterLinkCheck from "#root/lib/twitterLinkCheck.js";
import urql from "#root/lib/urql.js";
import { urql } from "#root/main.js";
import increment from "#root/lib/graphql/mutations/incrimentMutation.js";
import addGroup from "#root/lib/graphql/mutations/addGroupMutation.js";
import incrementGroup from "#root/lib/graphql/mutations/incrementGroupMutation.js";

View File

@@ -1,7 +1,7 @@
import { Composer } from "grammy";
import type { Context } from "#root/bot/context.js";
import { logHandle } from "#root/bot/helpers/logging.js";
import urql from "#root/lib/urql.js";
import { urql } from "#root/main.js";
import increment from "#root/lib/graphql/mutations/incrimentMutation.js";
const composer = new Composer<Context>();

View File

@@ -2,7 +2,7 @@ import { Composer } from "grammy";
import type { Context } from "#root/bot/context.js";
import { logHandle } from "#root/bot/helpers/logging.js";
import { metaRegex } from "#root/lib/metaLinkCheck.js";
import urql from "#root/lib/urql.js";
import { urql } from "#root/main.js";
import increment from "#root/lib/graphql/mutations/incrimentMutation.js";
import addGroup from "#root/lib/graphql/mutations/addGroupMutation.js";
import incrementGroup from "#root/lib/graphql/mutations/incrementGroupMutation.js";

View File

@@ -2,7 +2,7 @@ import { Composer } from "grammy";
import type { Context } from "#root/bot/context.js";
import { logHandle } from "#root/bot/helpers/logging.js";
import { twitterRegex } from "#root/lib/twitterLinkCheck.js";
import urql from "#root/lib/urql.js";
import { urql } from "#root/main.js";
import increment from "#root/lib/graphql/mutations/incrimentMutation.js";
import addGroup from "#root/lib/graphql/mutations/addGroupMutation.js";
import incrementGroup from "#root/lib/graphql/mutations/incrementGroupMutation.js";

View File

@@ -1,7 +1,7 @@
import { Composer } from "grammy";
import type { Context } from "#root/bot/context.js";
import { logHandle } from "#root/bot/helpers/logging.js";
import urql from "#root/lib/urql.js";
import { urql } from "#root/main.js";
import increment from "#root/lib/graphql/mutations/incrimentMutation.js";
const composer = new Composer<Context>();

View File

@@ -1,13 +0,0 @@
import { Client, cacheExchange, fetchExchange } from "@urql/core";
const urql = new Client({
url: process.env.GRAPHQL_URL || "",
exchanges: [cacheExchange, fetchExchange],
fetchOptions: {
headers: {
"x-api-key": process.env?.GRAPHQL_API_TOKEN || ""
}
}
});
export default urql;

View File

@@ -8,6 +8,7 @@ import { config } from "#root/config.js";
import { logger } from "#root/logger.js";
import { createServer, createServerManager } from "#root/server/index.js";
import { run } from "@grammyjs/runner";
import { Client, cacheExchange, fetchExchange } from "@urql/core";
async function startPolling(config: PollingConfig) {
const bot = createBot(config.botToken, {
@@ -112,3 +113,13 @@ function onShutdown(cleanUp: () => Promise<void>) {
process.on("SIGINT", handleShutdown);
process.on("SIGTERM", handleShutdown);
}
export const urql = new Client({
url: process.env.GRAPHQL_URL || "",
exchanges: [cacheExchange, fetchExchange],
fetchOptions: {
headers: {
"x-api-key": process.env?.GRAPHQL_API_TOKEN || ""
}
}
});