You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to get the videos.media relationship via the likes resource, so I'm trying to do the following query: GET localhost/api/v1/likes?include=likeable.contentable.media
but I get the error “Include path likeable.contentable.media is not allowed.”.
At the same time, if I want to get the videos.media relation via the contents resource, I make the following request: GET localhost/api/v1/contents?include=contentable.media and it works as it should!
At first, I thought it was the depth of the relationship, but changing the $maxDepth property in LikeSchema didn't work.
Moreover, if you try to replace MorphTo relationships (likes.likeable, contents.contentable) with any other ones, for example BelongsTo, everything works correctly.
The problem is in the MorphTo relation; After the second MorphTo relation in the include chain, the next relations in the chain do not want to be loaded.
The text was updated successfully, but these errors were encountered:
I don't think this is anything specific to the schemas and/or relationships themselves rather a limitation of the JsonApiRule::includePaths(), on the collection query class.
I don't have this issue when using the following workaround:
I have four schemas:
I need to get the
videos.media
relationship via thelikes
resource, so I'm trying to do the following query:GET localhost/api/v1/likes?include=likeable.contentable.media
but I get the error
“Include path likeable.contentable.media is not allowed.”
.At the same time, if I want to get the
videos.media
relation via thecontents
resource, I make the following request:GET localhost/api/v1/contents?include=contentable.media
and it works as it should!At first, I thought it was the depth of the relationship, but changing the
$maxDepth
property inLikeSchema
didn't work.Moreover, if you try to replace MorphTo relationships (
likes.likeable
,contents.contentable
) with any other ones, for example BelongsTo, everything works correctly.The problem is in the MorphTo relation; After the second MorphTo relation in the include chain, the next relations in the chain do not want to be loaded.
The text was updated successfully, but these errors were encountered: