We have noticed that something has changed in the graphql query interpreter. Before, such a query string was legit:
query() {
id
}
But now this breaks the site, because of the empty parentheses, without attributes. Did you guys perform some gql upgrade? If so, do you know of other possibly ābreakingā changes?
Is it possible to get heads up of changes like that?
hey @sharedcodingsans can you please share an actual query that was valid and itās not anymore?
Thanks!
Sure. As you can see we have a categoryFilter variabe which may be empty of may contain a category filter. this is inserted into the allBlogPostsMeta section, into parentheses. But if itās empty, we get an unresolved error that points to the closing parenthesis. This most definitely worked until⦠i would say 2 weeks ago. And the code has not been modified for more than a month now.
const categoryFilter = currentCategory ? `filter: {category: {allIn: ${currentCategory}}},` : '';
return query($limit: IntType, $skip: IntType) { ${headerRecord} ${footerRecord} blog { ${SeoRecord} allCategoryLabel ${categoryRecord} ${pageIntroRecord} bottomBlocks { ${blockWithCardsRecord} ${workWithUsRecord} } } blogListMeta: _allBlogPostsMeta(${categoryFilter}) { count } blogList: allBlogPosts(${categoryFilter} first: $limit, skip: $skip, orderBy: date_DESC) { author { nickname } ${categoryRecord} date intro title slug mainImage { alt url } } }
;
};
const categoryFilter = currentCategory ? `filter: {category: {allIn: ${currentCategory}}},` : '';
return `query($limit: IntType, $skip: IntType) {
${headerRecord}
${footerRecord}
blog {
${SeoRecord}
allCategoryLabel
${categoryRecord}
${pageIntroRecord}
bottomBlocks {
${blockWithCardsRecord}
${workWithUsRecord}
}
}
blogListMeta: _allBlogPostsMeta(${categoryFilter}) {
count
}
blogList: allBlogPosts(${categoryFilter} first: $limit, skip: $skip, orderBy: date_DESC) {
author {
nickname
}
${categoryRecord}
date
intro
title
slug
mainImage {
alt
url
}
}
}`;
Did you guys have a chance to look at this? @mat_jack1
hey @sharedcodingsans sorry I was on holidays, Iām back!
Regarding your issue, I think itās related to something that was permitted before but wasnāt actually a valid syntax 
Have you thought about moving the parenthesis inside the ternary operator, so that you donāt print anything at all?
Yes, thatās what we did and thatās what I was suspecting as well. So the ticket was written to find out:
- what changed (graphql engine upgrade?),
- from-to which version so maybe I can look up if there might be other hidden breaking changes with this upgrade (breaking for us anyway)
- also if it is possible to get some kind of heads up when main components of the dato infrastructure change / get upgraded
thx,
Krisz
@sharedcodingsans we did upgrade our GraphQL engine, yes. We performed one week of inspection on 50% of the total of queries made to the system (thatās about 20M+ requests) to see if there was any different behavior between the old and the new version. For each of these inconsistencies, we logged the project IDs, the precise queries performed and the number of queries.
Apart from minor nuances in how errors are reported, we found three notable differences (all bugfixes to make our responses more compliant to GraphQL standard), including the one you encountered.
For two of these three inconsistencies ā not the one you experienced, unfortunately ā we managed to still keep the old behavior in place, and just respond with a X-DatoCMS-Warnings
header for the foreseeable future. Unfortunately, for the third change (the one you experienced), we could not do that for technical reasons.
Less than 0.0001% of the queries (around 10 projects) had the āempty attribute listā error, so we decided to contact every project owner personally via e-mail to inform them about the change, and we made sure the upgrade didnāt cause any problems.
We then decided it was a more than a statistically significant number to proceed with the upgrade.
All this is to say that we tried to do everything as seamless as possible, and in general we succeeded, but evidently, despite extensive testing, we missed a few cases. To date, after weeks from the engine upgrade, in addition to yours we have received a second complaint for the same issue.
Iām very sorry about this, and weāll try to adopt an even safer process next time.
Hi Verna,
Iāve been on another project so itās only now Iām reading your answer. I can see that you guys are doing your best, thanks for going into the details and sharing this behind-the-curtain sneak peek into your processes 
These things happen, so no hard feelings from our side. Only one question: you write you contacted all the project owners where you could see such a query being run. Did we during this time not run such a query with empty attribute list, or the problem is more like you cannot tell from every project who was using this āinconsistencyā? After all, the code runs on Vercel so you couldnāt tell i presume.
The reason Iām asking is if you did try to contact us and we did not receive your warning that needs attention. Otherwise, all is good and well, thanks for keeping your system up to date.
Best,
Krisz
No, we did not contact you, probably because you ended up in the top 50% of requests that were not analyzed! Thank you for your understanding!
1 Like