Open openxyz opened 3 years ago
These are by default what gets called under the hood when you have an attribute filtered by the specified operator:
class PostResource < ApplicationResource
attribute :title, :string, filterable: true
end
# https://myapi.com/v1/posts?filter[title][prefix]=hello
That will call filter_string_prefix
when it resolves. These are all available on the resource's adapter though, so if you need to invoke them directly for some reason, you should be able to do it:
filter :some_field do
match do | scope ,value |
self.adapter.filter_string_match(value)
end
end
Graphiti::Adapters::ActiveRecord has some great function such as filter_string_match() etc.
but howto invoke it ?, for example: