-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Make sort/filter types optional and/or customizable #55
Labels
enhancement
New feature or request
Comments
Hey there! In the short term we can make the filter/sortability optional, but making it customizable per query would be a bit harder. I'll push up a resource-level toggle to turn those off, and then you can handle them yourself with arguments :) |
Alright, I've pushed up these options: graphql do
...
derive_filter? false
derive_sort? false
end |
Give main a shot and see how it goes :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Sort/filter types are always added by default in a GraphQL query by ash_graphql, but sometimes you want to implement your own sort/filter mechanism to limit what the users can do in your database (ex. restricting them from create not well optimized queries).
Describe the solution you'd like
I think there is two solutions here, it would be great to have both if possible.
The first one is to simply give an option to disable sort or filter types for an specific action.
The second one is to allow the user to customize these types for a specific option, for example, the user can say that what are the fields that the sort type can expose as sortable. That way I have the best of both words, I can restrict what fields can be filtered or sorted but still use the ash_graphql types so that is generated automatically for me instead of having to create a custom solution..
Express the feature either with a change to resource syntax, or with a change to the resource interface
For example
The text was updated successfully, but these errors were encountered: