Closed ghost closed 4 years ago
MorphMany
is equivalent to the monomorphic HasMany
, so sync
is not an available operation.
Dear @spawnia ,
That makes sense, but then what type of operation should I use in this case? I mean it's not like connect works either.
create
, update
, upsert
and delete
.
Ahh I see, so I can't directly connect the two, but rather I need to manually update the relation.
Thanks a lot!
Describe the bug
Okay, so this might not be the best platform, but I can't seem to determine wheter this is a bug or not, so I'll give it a shot here as well.
The problem is that when I created a fresh, crispy Laravel project, added lighthouse to it then followed the documentation on polymorphic relationships, made every modifcation exactly(almost) like the docs stated, and I just couldn't make it work.
Schema
Post Model
Image Model
Migrations
The mutation
Result:
Expected behavior/Solution Lighthouse connects the polymorphic relation in the given table and returns the result of the queried data.
Steps to reproduce
Lighthouse Version 4.12