Partners

Product Updates

DatoCMS changelog for new features and general improvements
UI ImprovementContent Delivery API
Easier pattern usage in GraphQL queries
November 14th, 2022

Despite being somewhat scary, regular expressions are a very powerful tool. DatoCMS supports regex for filtering patterns in GraphQL queries. We just improved how we report syntax errors in regex to ease their usage and provide more precise feedback.

Now, providing a query like this:

{
allBlogPosts(filter: {name: {matches: {pattern: "^+123"}}}) {
id
}
}

will get you the following error:

{
"data": null,
"errors": [
{
"message": "Invalid regular expression: quantifier operand invalid (provided regular expression: \"^+123\")",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"allBlogPosts"
]
}
]
}
We use cookies to enhance the user experience. Do you consent their use in accordance with our cookie policy?