What does "Could not embed because more than one r...
# help
s
What does "Could not embed because more than one relationship was found for 'blog_post' and 'users'" even mean? i have a FK in "blog_post", where author is linked to users id
s
@User Can you share the full error message? The "details" and "hint" fields have more information.
s
Thanks for making it a thread
@User it is about the same
I got it to work but I don't think I'm doing this correct
This is my js-code that works. it fetches the blogpost, and then adds the users name to it
The blogpost table has a column with authors, in the column the unique ID of the author is stored
The column author is connected to the table called users
so the FK in blogpost is -> ID in users
But when i try to do it as the API says i get the error
which i translate to this
which gives the following error
I think the setup of the FK is right, because when i press the "link" in the blogPost-table I get the data from the users-table
So that's where I'm kind of confused. The link, from blofgpost/author --> users seems to be working, since I can pull pull the data in the userstable from the blogpost-table
But the generated API for it gives me the error. And I have non - to my knowledge - any other relations between the tables.
but if I do the users!author(name) instead of user(id) it works.
So for some reason supabase (I guess) has trouble to define the relation between the tables when being queryied from "outside", but not within the supabase itself
I think.
I started with supabase two days ago so I could be totally of here..
here´s the full errormsg
Oh, this is.. embarrassing
I had a relation between blogComments and also the users table
if i removed that it works
not sure why, since the relation is from blog_posts to users, so i dont really grasp how it can become confused regarding the relation blogcomments and users.
But i guess it would have worked if i used "users!blog_post_author_id_fkey" which would have sorted out the confusion
coolers
Thanks anyway for your time 🙂
if you happen to know how to return is so it becomes "users: 'Fredrik the King", Iä'm all ears..