Weird type error when searching by Index
I get this error when trying to filter by an index, i created it in my schema too.
Argument of type 'string' is not assignable to parameter of type 'never'.ts(2345)
I ahve attached image of the query.


9 Replies
never type?
How can the parameter be never type though?
Yup there is never type in typescript bro
It's kind of special thing
hmm i dont get it though, i created the index and ffollowed the docs, got no clue why it's giving me that linter error
Try giving
ctx
a type annotation with MutaitonCtx
from _generated/server
? (https://labs.convex.dev/auth/advanced#writing-additional-data-during-authentication)
TS needs the type annotation to know about all the tables defined in your schema (not just the ones defined in the auth schema)Advanced: Details - Convex Auth
Authentication library for your Convex backend
Do you know what is never type?
I assume it means it never returns something?
@🐐GoatGuy🐐 yeah see Sarah's comment, there's no way that this callback function can know about all your other tables, it only knows about those that come with Convex Auth unless you use
MutationCtx
explicitly
When you write normal mutations etc. you use the mutation()
wrapper imported from ../convex/_generated/server
which imports from your schema. But the convexAuth()
function doens't know about your schema, it's imported from the Convex Auth library.Right. But there are some special cases.
We can't console.log(result)