Partners

Product Updates

DatoCMS changelog for new features and general improvements
NewContent Delivery API
Introducing explicit AND operators in filter expressions for enhanced convenience
April 19th, 2023

Filter expression conditions have always been implicitly combined using a logical AND. However, there are situations where explicitly incorporating an AND expression can greatly improve the filtering experience:

query {
allArtists(
filter: {
AND: [
{ name: { matches: { pattern: "Blank" } },
{ name: { matches: { pattern: "Banshee" } }
]
}
) {
id
name
genre
}
}

In the example provided, the same filter type is required multiple times within the same expression. Without an explicit AND operator, this would not be achievable.

We're excited to announce that alongside the pre-existing OR operator, you can now seamlessly incorporate explicit AND operators into your GraphQL queries for optimal flexibility and customization.