allow SearchFilter to generate _list parameters for all types, not just exact #2641
chuckadams
started this conversation in
Ideas
Replies: 1 comment
-
In the meantime, trying to extend SearchFilter meant copy-pasting the entire class and its trait, since the former is final and the second because traits can't be subclassed. I just went and patched SearchFilterTrait using cweagans/composer-patches (I'm already using that for other packages anyway), but am I overlooking a less evil way to go about this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a
User
class with SearchFilters on it, including these:When querying users through REST, I can easily do
/api/users?lastName[]=lebow&lastName[]=sobch
and pull up both users. But in graphql, I only gethandle_list
, but notfirstName_list
orlastName_list
. So I decided to try and fix this situation, and before I jumped into subclassing SearchFilter, I just edited SearchFilterTrait in the vendor/ dir directly to see what would happen if I changed this:to this:
and much to my delight and astonishment, It Just Worked. I got both
lastName
andlastName_list
parameters, and using the latter did exactly what I wanted. I can't be the only one who would like to OR together multiple partial searches, so is there any reason that the restriction on the 'exact' strategy shouldn't be lifted, allowing all SearchFilter fields to generate a _list version?Beta Was this translation helpful? Give feedback.
All reactions