From 029061e35ba1f163b492883a7384d57d6b118700 Mon Sep 17 00:00:00 2001 From: Lucid Date: Thu, 18 Dec 2025 21:00:49 -0500 Subject: [PATCH] fix cron? --- .github/workflows/cron.yml | 2 +- src/app/api/graphql/route.ts | 9 +++++---- src/graphql/resolvers.ts | 12 ++++++------ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 8030282..ca475dd 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -14,4 +14,4 @@ jobs: curl --request POST \ --url 'bot-stats.lucids-cove.duckdns.org/api/graphql' \ --header 'x-api-key: ${{ secrets.NEXT_PUBLIC_API_TOKEN }}' \ - --data '{ "query": "Cron { cronJob( mutationKey: ${{ secrets.GRAPHQL_MUTATION_KEY }} ) { commandResponses createdAt linksDeleted timesTriggered updatedAt } }" }' + --data '{ "query": "mutation Cron { cronJob(mutationKey: \"${{ secrets.GRAPHQL_MUTATION_KEY }}\") { commandResponses createdAt linksDeleted timesTriggered updatedAt } }" }' diff --git a/src/app/api/graphql/route.ts b/src/app/api/graphql/route.ts index 384c403..b26009b 100644 --- a/src/app/api/graphql/route.ts +++ b/src/app/api/graphql/route.ts @@ -1,6 +1,7 @@ +/* eslint-disable no-unused-vars */ /* eslint-disable react-hooks/rules-of-hooks */ import { createYoga, Plugin, createSchema } from "graphql-yoga"; -import { EnvelopArmorPlugin } from "@escape.tech/graphql-armor"; +// import { EnvelopArmorPlugin } from "@escape.tech/graphql-armor"; import resolvers from "@/graphql/resolvers"; import typeDefs from "@/graphql/types"; @@ -59,10 +60,10 @@ const { handleRequest } = createYoga({ graphqlEndpoint: "/api/graphql", // Yoga needs to know how to create a valid Next response - fetchAPI: { Response }, + fetchAPI: { Response } - plugins: [useApiKey(), EnvelopArmorPlugin()], - graphiql: environment !== "production" ? true : false + // plugins: [useApiKey(), EnvelopArmorPlugin()], + // graphiql: environment !== "production" ? true : false }); export { diff --git a/src/graphql/resolvers.ts b/src/graphql/resolvers.ts index 1783496..fa38275 100644 --- a/src/graphql/resolvers.ts +++ b/src/graphql/resolvers.ts @@ -120,13 +120,13 @@ export const resolvers = { } } - const latestDailyStats = await getLatestDailyStat(); + // const latestDailyStats = await getLatestDailyStat(); - if (latestDailyStats !== null) { - if (isDailyStatToday(String(latestDailyStats.createdAt))) { - return null; - } - } + // if (latestDailyStats !== null) { + // if (isDailyStatToday(String(latestDailyStats.createdAt))) { + // return null; + // } + // } const date = new Date().toISOString();