how to query using related table #590
Answered
by
yoshinorihisakawa
yoshinorihisakawa
asked this question in
Questions
-
I wanna use group Object. typecript import { createClient } from '@supabase/supabase-js'
const options = { }
const sss = createClient("https://xxx.co", "xxx..", options)
type group = {
id: number;
name: string;
}
type user = {
id: number;
group: group;
}
const response = async () => {
const response = await sss
.from<user>('user')
.select('id, group:id ( name )')
console.log(response.data)
}
response() response
|
Beta Was this translation helpful? Give feedback.
Answered by
yoshinorihisakawa
Jan 23, 2021
Replies: 1 comment
-
and response.data[0].group is fine |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
inian
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#539
and
response.data[0].group
is fine