-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
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
Enable filters in model resolver #9
Comments
@randomiser I added demo test for the case (see the link to commit above) - nested filter works for me. Please check what's different with your case.
It should, but it's currently either "all in" or fully disabled (which is the default). Ideally it should allow fine-grained setup so that filtering only on certain fields could be enabled. Otherwise, it might introduce a security risk in certain cases. |
Hi Ilya, I was basing my assumptions on how this worked on this document: https://github.com/IlyaSemenov/objection-graphql-resolver/blob/master/docs/filters.md I hadn't realised I would need to explicitly add a RelationResolver into the ModelResolver to get this working. Now I've made the change as per your test it's working fine. Thank you! Suggest you could add this RelationResolver information into the filters.md documentation. Would stop questions like this happening again. Thanks again, great library! |
I see. So two problems here:
I'll take care of this. |
🎉 This issue has been resolved in version 6.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
It's now possible to set Unfortunately, that means migrating to the new API. (In fact, it's possible to back-port that to the old API which is still supported.) |
Howdy again,
Following the docs for filtering I'm attempting to filter at a deep level only.
When I attempt to call queries that involve several levels of joins such as the following the query isn't amended to include the filter I've included and returns all of the records.
I've switched on filter: true for all models and set it at the resolver level, and updated the GQL to include the filter options.
I notice your docs state "TODO" against some of the extra filtering options. Should this case work currently? I've tried other variants like status__in: [pending] and adding a modifier to the model directly and calling that.
EDIT: added code formatting - Ilya
The text was updated successfully, but these errors were encountered: