-
-
Notifications
You must be signed in to change notification settings - Fork 160
Type error: referencing missing column count
#447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks David, I'll try to reproduce this. Is |
@soedirgo Thank you! |
It's actually happening to me with a much simpler query: const res = await supabase
.from("brand_locations")
.select("count", { count: "estimated", head: true })
.eq("brand_id", brandId); Again, it's returning EDIT: Nevermind, I forgot you don't need to select count if it's not a foreign table. |
This is happening to me with this query: const someQuery = await supabase
.from('someTable')
.select(
`id,
fk:foreign_key_id(id, name)
`
) I believe it has to do with this pr I've verified that my types file is correct, the column I believe the expected behaviour is that |
@soedirgo did you ever get a chance to test? Curious if this is intended behavior, or a bug |
I have the same problem after upgrading. Also this seems to be a duplicate: #449 |
🎉 This issue has been resolved in version 1.13.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I am having the same issue with I am attempting to fetch a list of jobs and their applications count. I have a jobs table and an applications table which references the jobs table. As you will see below, I get the results I want from the query I make but typescript cannot resolve Here is my query: const { data: jobsData, error: jobsError } = await supabase
.from("jobs")
.select(`id, job_title, industry, employer, applications(count)`)
.eq("employer", userId); Hovering over const jobsData: {
id: string;
job_title: string;
industry: string;
employer: string;
rocket_applications: SelectQueryError<"Referencing missing column `count`">[];
}[] | null One of the job objects from the response I get: {
"id": "dad00615-9990-4c56-a39d-94ae32ba1133",
"job_title": "Waiter/Waitress",
"industry": "Real Estate",
"employer": "b8e1aaed-c21b-485b-a9e6-50f0ae6d7016",
"rocket_applications": [
{
"count": 6
}
]
} |
Bug report
Describe the bug
After upgrading
@supabase/supabase-js
to2.26.0
, I'm now getting a type error when queryingcount
for a nested relationship. The API is returning the count exactly as before, so it's only a type issue.To Reproduce
count
of a nested relationship.Example query:
In this example,
brand_locations(count)
is what's causing the error.The returned type for that field is
SelectQueryError
even though no error is thrown from the API.Expected behavior
The returned type of a
count
should not beSelectQueryError
.Screenshots
System information
v2.26.0
v18.17.0
The text was updated successfully, but these errors were encountered: