naveedehmadN
Convex Community7mo ago
3 replies
naveedehmad

having a weird type error on the `email` index on user

for some reason on
users
table when i try to query on the index email i'm getting Argument of type 'string' is not assignable to parameter of type 'never'error. here's my user schema:

  users: defineTable({
    firstName: v.string(),
    lastName: v.string(),
    name: v.string(),
    email: v.string(),
    status: v.optional(v.union(v.literal('active'), v.literal('invited'), v.literal('disabled'))),
  }).index('email', ['email']),


and i have this query:
      const existingUser = await ctx.db
        .query('users')
        .withIndex('email', (q) => q.eq('email', args.profile.email))
        .unique();


i'm getting type error on the
index
field for whatever reason. any help would be appreciated.
Was this page helpful?