BUG: Incorrect content delivery API response

I’ve been banging my head on this for a few hours and it has been extremely frustrating.

Out of nowhere, the API stopped delivering payloads from staging environments as well as draft records. What appears to be happening is a silent fallback to published, production records (or an incorrect CDN cache hit).

I’ve isolated the problem to having a payload that includes null values for BOTH “variables” and “operationName”. Removing either key from the payload fixes the problem.

Unfortunately, the client I’m using automatically appends these keys, so I’m stuck until this is fixed.

Example (failing, returning data from the primary environment):

POST https://graphql.datocms.com/ HTTP/1.1
Authorization: REDACTED
Content-Type: application/json
Accept: application/json
X-Environment: development
X-Include-Drafts: true

{“query”:"{ _site { globalSeo { siteName } } }",“variables”:null,“operationName”:null}

Example (succeeding, returning data from the development environment):

POST https://graphql.datocms.com/ HTTP/1.1
Authorization: REDACTED
Content-Type: application/json
Accept: application/json
X-Environment: development
X-Include-Drafts: true

{“query”:"{ _site { globalSeo { siteName } } }"}

Please help.

Hello, we have found a small issue that could explain this behaviour. Could you please retry and see if the problem is solved? If that’s not the case, please send us a mail at support@datocms.com with the requests complete with token/project ID, thanks!

It seems to be working now, thank you.