{ testDb().then(setResult) }, [])"> { testDb().then(setResult) }, [])"> { testDb().then(setResult) }, [])">
export async function testDb() {
const { data } = await run(
db.from('test_users').select('name, test_contracts(question)')
)
console.log('data', data)
return data
}
// "Try changing 'test_contracts' to one of the following:
// 'test_contracts!test_contracts_creator_fkey',
// 'test_contracts!test_user_contracts'. Find the desired relationship in the 'details' key."
"Try changing 'test_contracts' to one of the following: 'test_contracts!test_contracts_creator_fkey', 'test_contracts!test_user_contracts'. Find the desired relationship in the 'details' key."
Bonus:
// Set up a useEffect for the result of an async call
const [result, setResult] = useState(undefined)
useEffect(() => {
testDb().then(setResult)
}, [])