Incorrect types on SELECT when spreading related tables
masda70 opened this issue · comments
David Montoya commented
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
Spreading related tables, as described in this article , are not properly typed.
const { data } = await supabase.from('films').select(`
title,
...technical_specs (
camera, laboratory, duration
)
`)
console.log(data)
yields ParserError<"Expected identifier at ...technical_specs (camera, laboratory, duration)
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Use the table definitions from https://supabase.com/blog/postgrest-11-prerelease
- Write the above code within a supabase client environment.
- Build the project
Expected behavior
The type should be {title: string, camera: string, laboratory: string, duration: string}[] | null
System information
- OS: [e.g. Ubuntu]
- Version of supabase-js: 2.37.0
- Version of Node.js: v18.17.1