© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
7 replies
Zeeshan

how to get access of another table based off foreign key?

while fetching dishes table, i want to fetch the user's name based on the user_id which is common to both the recipes and user_profiles table.

i have followed the docs at https://supabase.com/docs/guides/api/joins-and-nesting?language=js&output-format=table and ended up with the following code

const { data } = await client
        .from("influencer_dishes")
        .select(`name, total_orders, price,       user_profiles (user_id, name)`)
const { data } = await client
        .from("influencer_dishes")
        .select(`name, total_orders, price,       user_profiles (user_id, name)`)


but when i check network tab, it returns 400 and error message as follows

Could not find a relationship between 'influencer_dishes' and 'user_profiles' in the schema cache
Could not find a relationship between 'influencer_dishes' and 'user_profiles' in the schema cache


what am i doing wrong?
Querying Joins and Nested tables | Supabase Docs
The Data APIs automatically detect relationships between Postgres tables.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to use composite key as foreign key in another table?
SupabaseSSupabase / help-and-questions
4y ago
How to get data from foreign table based on parent table
SupabaseSSupabase / help-and-questions
4y ago
POST request using foreign key-table
SupabaseSSupabase / help-and-questions
4y ago
Foreign key from Prisma table to auth.users
SupabaseSSupabase / help-and-questions
4y ago