postgraphile-plugin-connection-filter
postgraphile-plugin-connection-filter copied to clipboard
Support passing arguments to functions as filters
Computed columns support functions and will expose the new field as a filter as long as there are no required arguments. Providing defaults for the arguments will allow the function to be used as a filter, but it is not currently possible to provide a value to use in place of the defaults. Would you be willing to support a new property, alongside the operators, which would take an object containing the arguments to pass to the function?
Given the example in #110, this would allow a filter like:
filter: {
distance_from: {
lessThan: 300
args: {
origin_lat: 51.111
origin_lng: -7.123123
}
}
}
+1 This would help us as well quite a bit. It would eliminate the need for running several plugins (currently we might need: https://github.com/RoadRunnerEngineering/postgraphile-plugin-custom-filter to accommodate this).
:+1: I can see that being useful. I don't have the bandwidth to tackle this right now, but would definitely welcome a PR.