Hello, i am trying to use API method getByType from prismicio/client, everything works fine, except for filtering. My main goal is getting all pages with type 'blog_post' filtered by 'categories' field. It does not work (not only this filter, any filter that i have tried, even from documentation examples - I have provided a code example of such case). Also, code editor shows an error (attached below). Are filters not supported yet for this method or am I applying them incorrectly?
Hello @Priyanka
I have found that it wasn't working, because i was using the wrong client and wrong version of it. So it recognises filters now. I have one more question though. I am trying to access a field which is an array like this:
I get an error: Error: [function at(..)] unexpected field 'my.blog_post.categories' on line:1 col:6 in query
There certainly is such field. Also, it recognises all other fields besides this one, probably because of its type. Is there any way to handle fields that are arrays? My use case is to filter by category, e.g. get all blog posts with category 'News'
Hello @Priyanka
the at filters work perfectly fine without ID for all fields, except for one (categories), which returns an array of objects. Also, I am trying to get all documents of a specific type (blog_post), which match the filters, so I can't really pass linked document id, as i need many documents.
Hey, @nick-east no, I didn't get a response after sending repo name and unfortunately, we've decided not to implement the feature that we wanted, because nothing seemed to work