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.