AddIncludesToQuery does not take place when allowed includes are not provided #930
Unanswered
karinarastsinskagia
asked this question in
General
Replies: 1 comment
-
|
Hello, Do you have any feedback for the above? Thank you |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I recently discovered that, when I use the
QueryBuilderfor a Model, where I do not want to allow any included fields,I do not receive the expected exception error message, if an include input is defined in the query.
For example, suppose that we have defined the following query builder for our model :
QueryBuilder::for(Article::class)->allowedSorts(['id']);In this case, we have not set
allowedIncludesoptions. So, if we receive a query like this :GET /articles/1?include=commentsWe would expect to get an invalid includes query exception. However, this is not happening since the
AddsIncludesToQuerytrait is not used.So, I would like to ask , if this is the proper behaviour or if this is something we can add support for? To keep receiving exceptions regardless of not using the
allowedIncludesmethod.Thank you in advance.
PS. The same question is about the
allowedSorts.Beta Was this translation helpful? Give feedback.
All reactions