Typescript Error when Using Booleans in Predicates

I believe this might be a bug.

When trying to do the following code...

 const filters   = await client.getAllByType("branch_service_tag", {
        predicates: [prismic.predicate.at("my.branch_service_tag.is_filter", true)]
    });

... using a Typescript project, I get an error that the predicate function only allows a string or number. If I try using "true" or 1 in place of the true in order to be compliant then I get a hard error that the field is expecting a boolean. If I put in a boolean true it works but Typescript marks it as an error.

Is there maybe a way I'm SUPPOSED to be querying for bools or is this just an error in the prismic implementation.

Hi @dhayes,

Thanks for reaching out, I have reported the issue to our dev team, and they will investigate it as soon as possible.

Once I get feedback and will return it to you,

Best,
Fares

1 Like

Hi,

I've got some updates from our team, and it seems there is a bug in the typings of the boolean predicates.

So we have created an issue for that, and our dev team will work on it soon.

Also, feel free to propose a PR if you would like to contribute.

Best,
Fares

1 Like

Hi,
This issue has been fixed; can you please confirm?