tRPCttRPC
Powered by
agiA
tRPC•3y ago
agi

Type '{}' is not assignable in server query

Type '{ input: { slug: string; }; "": any; }' is not assignable to type 'string | StringFilter<"Category"> | undefined'.


 ts    getCategoryBySlug: publicProcedure
    .input(z.object({ slug: z.string() }))

    .query(async ({ input, ctx }) => {
      const category = await ctx.prisma.category.findUnique({
        where: {
          slug: {input.slug},
        },
      });
 ts    getCategoryBySlug: publicProcedure
    .input(z.object({ slug: z.string() }))

    .query(async ({ input, ctx }) => {
      const category = await ctx.prisma.category.findUnique({
        where: {
          slug: {input.slug},
        },
      });
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Argument of Type not assignable
automataAautomata / ❓-help
3y ago
Type 'QueryClient' is missing the following properties from type 'QueryClient': queryCache, mutation
sh03Ssh03 / ❓-help
2y ago
Type 'QueryClient' is missing the following properties from type 'QueryClient': queryCache, mutation
JonathanJJonathan / ❓-help
3y ago
Why am I getting 'Argument type is not assignable to parameter type ProcedureResolver<unknown>'?
Raul FernandezRRaul Fernandez / ❓-help
3y ago