Enum searching with regexp


I have a question about the @search directive on enum types.

My schema contains an enum called BloodType with several blood type values (e.g. A_NEG). In a field on a type called Donor there can only be one BloodType so it’s represented as bloodType: BloodType!. I added in @search[exact, regexp] to be able to pass in something like A_NEG|B_NEG|O_POS so that when I query on this type, I’m able to get back all instances of Donor that have one of those three values as their bloodType field. However, when I run the query I get an error saying that eq should be provided so I’m curious as to whether the regexp will actually work the way I want it to or whether I’ll have to build a series of nested DonorFilter objects with the or field.

The example in the documentation looks similar to what I’m doing except that the field is an array (e.g. [Tag!]!). Am I missing something?



Hi @forstmeier, this is known bug and will be fixed soon. Till then you can remove the restriction of nonNull from bloodType and it should work fine.

Hi @minhaj just to confirm: in this case, without the ! for bloodType (which I can live with for now) the A_NEG|B_NEG|O_POS would return any Donor with a matching bloodType in those three options even with the field as a singular value and not an array?