Bug report
Describe the bug
Hey guys, I am not an expert around here but hear me out :)
Based on docs here on how to order the query result on a referenced table .
const { data, error } = await supabase
.from('countries')
.select(`
name,
cities (
name
)
`)
.order('name', { referencedTable: 'cities', ascending: false })
First issue is that, maybe the docs is outdated but, this options key is called foreignTable in the supabase-js package 2.38.3.
Secondly, when i add foreignTable option to order the foreign table that comes with the query, in Typescript, I am given the columns of the base table of the query (countries in this example) as autocomplete. Though, I can still use the desired column name as the order value and TS will not yell about it.
Expected behavior
If I want to order the foreign table and add that option key, TS should recognize that so I should be able to use the columns of that table to order. The inferred type is still the columns of the base table.
System information
- Version of supabase-js: [2.38.3]
Bug report
Describe the bug
Hey guys, I am not an expert around here but hear me out :)
Based on docs here on how to order the query result
on a referenced table.First issue is that, maybe the docs is outdated but, this options key is called
foreignTablein thesupabase-jspackage2.38.3.Secondly, when i add foreignTable option to order the foreign table that comes with the query, in Typescript, I am given the columns of the base table of the query (
countriesin this example) as autocomplete. Though, I can still use the desired column name as the order value and TS will not yell about it.Expected behavior
If I want to order the foreign table and add that option key, TS should recognize that so I should be able to use the columns of that table to order. The inferred type is still the columns of the base table.
System information