Skip to content

Commit

Permalink
fix:type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shivasankaran18 committed Feb 8, 2025
1 parent cd5bb4a commit e8f7eb3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/graphql/inputs/MutationUpdateAgendaItemInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ export const MutationUpdateAgendaItemInput = builder
description: "Name of the agenda item.",
}),
}),
});
});
16 changes: 10 additions & 6 deletions src/graphql/types/Mutation/updateAgendaItem.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
import { eq } from "drizzle-orm";

import { z } from "zod";
import { agendaItemsTable } from "~/src/drizzle/tables/agendaItems";
import { builder } from "~/src/graphql/builder";
import type { MutationUpdateAgendaItemInput as typeMutationUpdateAgendaItemInput } from "~/src/graphql/inputs/MutationUpdateAgendaItemInput";
import {
MutationUpdateAgendaItemInput,
mutationUpdateAgendaItemInputSchema,
} from "~/src/graphql/inputs/MutationUpdateAgendaItemInput";
import { AgendaItem } from "~/src/graphql/types/AgendaItem/AgendaItem";
import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError";
import { isNotNullish } from "~/src/utilities/isNotNullish";
import { GraphQLContext } from '~/src/graphql/context';
import type { GraphQLContext } from '~/src/graphql/context';

const mutationUpdateAgendaItemArgumentsSchema = z.object({
input: mutationUpdateAgendaItemInputSchema,
});

export async function updateAgendaItemResolver(_parent: unknown, args: {
input: typeof typeMutationUpdateAgendaItemInput
export async function updateAgendaItemResolver(_parent: unknown, args: {
input: {
id: string;
name?: string | null | undefined;
description?: string | null | undefined;
duration?: string | null | undefined;
folderId?: string | null | undefined;
key?: string | null | undefined;
}
},ctx: GraphQLContext){
if (!ctx.currentClient.isAuthenticated) {
throw new TalawaGraphQLError({
Expand Down Expand Up @@ -290,7 +295,6 @@ builder.mutationField("updateAgendaItem", (t) =>
}),
},
description: "Mutation field to update an agenda item.",
//@ts-ignore
resolve: updateAgendaItemResolver,
type: AgendaItem,
}),
Expand Down
2 changes: 0 additions & 2 deletions test/graphql/types/Mutation/updateAgendaItem.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { describe, beforeEach, it, expect, vi } from "vitest";
import { updateAgendaItemResolver } from "~/src/graphql/types/Mutation/updateAgendaItem";



const drizzleClientMock = {
query: {
usersTable: {
Expand Down

0 comments on commit e8f7eb3

Please sign in to comment.