Skip to content

Commit

Permalink
feat: remove GraphQL functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnntropy committed Mar 2, 2024
1 parent 2eb92d9 commit 73d85e3
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 295 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
"deep-object-diff": "^1.1.0",
"discord.js": "^14.14.1",
"form-data": "^4.0.0",
"graphql": "^16.1.0",
"graphql-tools": "^8.2.0",
"kubernetes-client": "^9.0.0",
"lodash": "^4.17.21",
"mime-types": "^2.1.30",
Expand Down
14 changes: 0 additions & 14 deletions src/graphql/index.ts

This file was deleted.

30 changes: 0 additions & 30 deletions src/graphql/resolvers.ts

This file was deleted.

75 changes: 0 additions & 75 deletions src/graphql/schema.graphql

This file was deleted.

4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logger from "./logger";
import environment from "./environment";
import client from "./client";
import { server as graphqlServer } from "./graphql";
import * as Sentry from "@sentry/node";
import "@sentry/tracing";

Expand All @@ -13,9 +12,6 @@ Sentry.init({
const main = async () => {
logger.info("Starting client...");
await client.login(environment.TOKEN);

logger.info("Starting GraphQL server...");
await graphqlServer.listen();
};

main();
2 changes: 0 additions & 2 deletions src/internal/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { CronJob } from "cron";
import { ClientEvents, Snowflake } from "discord.js";
import { IResolvers } from "@graphql-tools/utils";
import { AppEventHandler } from "../emitter";
import { Command } from "./command";

Expand All @@ -15,7 +14,6 @@ export interface HandlerCollection {
export interface Module {
commands: Command[];
handlers: HandlerCollection;
resolvers?: IResolvers;
appEventHandlers?: AppEventHandler[];
cronJobs?: CronJob[];
}
Expand Down
24 changes: 0 additions & 24 deletions src/modules/QuotesModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import logger from "../logger";
import config from "../config";
import { Command, CommandSubCommand } from "../internal/command";
import { Module, SerializableMessage } from "../internal/types";
import { GraphQLFieldResolver } from "graphql";
import { buildUsernameString } from "../utils/strings";
import { Channel } from "diagnostics_channel";

Expand Down Expand Up @@ -335,24 +334,6 @@ class QuotesCommand extends Command {
}
}

const quotesResolver: GraphQLFieldResolver<
any,
any,
{ searchInput: { guildId: string; query?: string; userId?: string } }
> = async (_, args) => {
const { searchInput } = args;

const results = await searchQuotes({
returnAll: true,
guildId: searchInput.guildId,
query: searchInput.query,
userId: searchInput.userId,
fetchMembers: true,
});

return results;
};

const buildEmbedForQuotedMessage = async (
message: SerializableMessage,
quoteId: number
Expand Down Expand Up @@ -531,11 +512,6 @@ const searchQuotes = async (input: SearchInput) => {
const QuotesModule: Module = {
commands: [new QuotesCommand()],
handlers: {},
resolvers: {
Query: {
quotes: quotesResolver,
},
},
};

export default QuotesModule;
4 changes: 0 additions & 4 deletions src/modules/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { flatten } from "lodash";
import emitter from "../emitter";
import { mergeResolverDefinitions } from "../utils/graphql";
import { mergeHandlerCollections } from "../utils/modules";
import BotAdministrationModule from "./BotAdministrationModule";
import FunModule from "./FunModule";
Expand Down Expand Up @@ -60,6 +59,3 @@ for (const module of modules) {

export const commands = flatten(modules.map((m) => m.commands));
export const handlers = mergeHandlerCollections(modules.map((m) => m.handlers));
export const resolvers = mergeResolverDefinitions(
modules.map((m) => m.resolvers ?? {})
);
5 changes: 0 additions & 5 deletions src/utils/graphql.ts

This file was deleted.

Loading

0 comments on commit 73d85e3

Please sign in to comment.