We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey there!
I just created a model and also a default scope for its relation:
Mother.json
"scope": { "include": [ { "relation": "children" }, ] }
When I do a normal query at /api/mother I get all children. Fine.
But when I try this:
/api/mother/?filter={"include": [ { "relation": "children", "scope": { "name": "Barney" } } ] }
I still get all children. When I remove the default scope, my query works.
It would be really nice, if the default scope for "children" gets overridden, if I provide a custom scope in my query.
I hope you understand what I mean :)
👍 👍 👍 LOOPBACK IS AWESOME!!!
The text was updated successfully, but these errors were encountered:
hi @smith64fx, this is related to datasource-juggler
For track record, see this existing (though outdated) PR: #787
the overall rationale is the following: for security reasons, it should not be possible to override a scope to make it more open
in your specific case though the rationale does not apply as you narrow the scope.
👉 first of all, check your code: you are missing a where clause in your scope:
where
should be
"include": [ { "relation": "children", "scope": { where: { "name": "Barney" } } } ]
Sorry, something went wrong.
No branches or pull requests
Hey there!
Description/Steps to reproduce
I just created a model and also a default scope for its relation:
Mother.json
When I do a normal query at /api/mother I get all children. Fine.
But when I try this:
I still get all children.
When I remove the default scope, my query works.
Expected result
It would be really nice, if the default scope for "children" gets overridden, if I provide a custom scope in my query.
Additional information
I hope you understand what I mean :)
👍 👍 👍 LOOPBACK IS AWESOME!!!
The text was updated successfully, but these errors were encountered: