Added urql and client
This commit is contained in:
@@ -7,4 +7,5 @@ BOT_WEBHOOK_SECRET=RANDOM_SECRET_VALUE
|
|||||||
SERVER_HOST=localhost
|
SERVER_HOST=localhost
|
||||||
SERVER_PORT=3000
|
SERVER_PORT=3000
|
||||||
BOT_ADMINS=[1]
|
BOT_ADMINS=[1]
|
||||||
GROUP_IDS=-
|
GROUP_IDS=-
|
||||||
|
GRAPHQL_URL=http://localhost:3000/api/graphql
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "no-twitter-bot",
|
"name": "no-twitter-bot",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "3.0.0",
|
"version": "3.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "yarn@4.9.2",
|
"packageManager": "yarn@4.9.2",
|
||||||
"description": "This grammY powered Telegram bot is designed to delete Twitter/X links and reformat services from whitelisted groups. This one is the main bot for the LCM Telegram groups/communities.",
|
"description": "This grammY powered Telegram bot is designed to delete Twitter/X links and reformat services from whitelisted groups. This one is the main bot for the LCM Telegram groups/communities.",
|
||||||
@@ -34,6 +34,7 @@
|
|||||||
"@grammyjs/runner": "2.0.3",
|
"@grammyjs/runner": "2.0.3",
|
||||||
"@grammyjs/types": "3.22.2",
|
"@grammyjs/types": "3.22.2",
|
||||||
"@hono/node-server": "1.19.4",
|
"@hono/node-server": "1.19.4",
|
||||||
|
"@urql/core": "^6.0.1",
|
||||||
"callback-data": "1.1.1",
|
"callback-data": "1.1.1",
|
||||||
"grammy": "1.38.2",
|
"grammy": "1.38.2",
|
||||||
"hono": "4.9.9",
|
"hono": "4.9.9",
|
||||||
|
|||||||
10
src/lib/urql.ts
Normal file
10
src/lib/urql.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { Client, cacheExchange, fetchExchange } from "@urql/core";
|
||||||
|
|
||||||
|
const urql = new Client({
|
||||||
|
url: process.env.GRAPHQL_URL || "",
|
||||||
|
exchanges: [cacheExchange, fetchExchange]
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`GRAPHQL_URL`, process.env.GRAPHQL_URL);
|
||||||
|
|
||||||
|
export default urql;
|
||||||
30
yarn.lock
30
yarn.lock
@@ -5,6 +5,18 @@ __metadata:
|
|||||||
version: 8
|
version: 8
|
||||||
cacheKey: 10c0
|
cacheKey: 10c0
|
||||||
|
|
||||||
|
"@0no-co/graphql.web@npm:^1.0.13":
|
||||||
|
version: 1.2.0
|
||||||
|
resolution: "@0no-co/graphql.web@npm:1.2.0"
|
||||||
|
peerDependencies:
|
||||||
|
graphql: ^14.0.0 || ^15.0.0 || ^16.0.0
|
||||||
|
peerDependenciesMeta:
|
||||||
|
graphql:
|
||||||
|
optional: true
|
||||||
|
checksum: 10c0/4eed600962bfab42afb49cddcfb31a47b00502f59707609cf160559920ce0f5cf8874791e4cafc465ede30ae291992f3f892bc757b2a989e80e50e358f71c518
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@antfu/eslint-config@npm:5.4.1":
|
"@antfu/eslint-config@npm:5.4.1":
|
||||||
version: 5.4.1
|
version: 5.4.1
|
||||||
resolution: "@antfu/eslint-config@npm:5.4.1"
|
resolution: "@antfu/eslint-config@npm:5.4.1"
|
||||||
@@ -1063,6 +1075,16 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@urql/core@npm:^6.0.1":
|
||||||
|
version: 6.0.1
|
||||||
|
resolution: "@urql/core@npm:6.0.1"
|
||||||
|
dependencies:
|
||||||
|
"@0no-co/graphql.web": "npm:^1.0.13"
|
||||||
|
wonka: "npm:^6.3.2"
|
||||||
|
checksum: 10c0/44ff0d12dcef1e47338a9ff1217759d1124fa66eec1eec21ff9622e44c179b9d66fa78f462f195bfd8b790b04609abbe5a0674cbfcb0bc6d9c6fe6223d7d7b5b
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@vitest/eslint-plugin@npm:^1.3.12":
|
"@vitest/eslint-plugin@npm:^1.3.12":
|
||||||
version: 1.3.13
|
version: 1.3.13
|
||||||
resolution: "@vitest/eslint-plugin@npm:1.3.13"
|
resolution: "@vitest/eslint-plugin@npm:1.3.13"
|
||||||
@@ -3744,6 +3766,7 @@ __metadata:
|
|||||||
"@grammyjs/types": "npm:3.22.2"
|
"@grammyjs/types": "npm:3.22.2"
|
||||||
"@hono/node-server": "npm:1.19.4"
|
"@hono/node-server": "npm:1.19.4"
|
||||||
"@types/node": "npm:^24.5.2"
|
"@types/node": "npm:^24.5.2"
|
||||||
|
"@urql/core": "npm:^6.0.1"
|
||||||
callback-data: "npm:1.1.1"
|
callback-data: "npm:1.1.1"
|
||||||
eslint: "npm:^9.36.0"
|
eslint: "npm:^9.36.0"
|
||||||
grammy: "npm:1.38.2"
|
grammy: "npm:1.38.2"
|
||||||
@@ -4976,6 +4999,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"wonka@npm:^6.3.2":
|
||||||
|
version: 6.3.5
|
||||||
|
resolution: "wonka@npm:6.3.5"
|
||||||
|
checksum: 10c0/044fe5ae26c0a32b0a1603cc0ed71ede8c9febe5bb3adab4fad5e088ceee600a84a08d0deb95a72189bbaf0d510282d183b6fb7b6e9837e7a1c9b209f788dd07
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"word-wrap@npm:^1.2.5":
|
"word-wrap@npm:^1.2.5":
|
||||||
version: 1.2.5
|
version: 1.2.5
|
||||||
resolution: "word-wrap@npm:1.2.5"
|
resolution: "word-wrap@npm:1.2.5"
|
||||||
|
|||||||
Reference in New Issue
Block a user