Product Updates

DatoCMS changelog for new features and general improvements
UI Improvement Content 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"
]
}
]
}
Start using DatoCMS today
According to Gartner 89% of companies plan to compete primarily on the basis of customer experience this year. Don't get caught unprepared.
  • No credit card
  • Easy setup
Subscribe to our newsletter! 📥
One update per month. All the latest news and sneak peeks directly in your inbox.
support@datocms.com ©2024 Dato srl, all rights reserved P.IVA 06969620480