Types and generic from<T>
#6816
Unanswered
AlbinoGeek
asked this question in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from<T>
#6816
-
Synopsis
The types in
@supabase/supabase-js
such asUser
don't quite line up with.from<T>(string)
don't quite line up with their usage, such as.eq('email_confirmed_at', null)
.Description
So, say we use a type like
User
from@supabase/supabase-js
Then we write a query using one of the "possibly undefined" fields:
Now, unfortunately, this fails ESLint, because
null
isn't a valid value foremail_confirmed_at
.The same thing happens when using Update.
Possible Solutions
Maybe
eq
and other comparators should acceptT | null
as it's value, so thatnull
is always a valid value?This is an idea versus an issue, because I'm not sold on this being the solution. I'd rather someone who uses supabase more than me weigh in on the implications of such a change.
Disclaimer: Yes, I'm aware
User
might not be the best example, sinceauth
is a private collection, but this applies to all types that useundefined
as their default value, which includes types I make.Beta Was this translation helpful? Give feedback.
All reactions