gatsbyjs/gatsby · error

An empty string was returned instead of a response when ma

Error message


An empty string was returned instead of a response when making a GraphQL request.
This may indicate that you have a WordPress filter running which is causing WPGraphQL
to return an empty string instead of a response.
Please open an issue with a reproduction at
https://github.com/gatsbyjs/gatsby/issues/new
for more help

${errorContext}

What it means

Error " An empty string was returned instead of a response when making a GraphQL request. This may indicate that you have a WordPress filter running which is causing WPGraphQL to return an empty string instead of a response. Please open an issue with a reproduction at https://github.com/gatsbyjs/gatsby/issues/new for more help ${errorContext} " thrown in gatsbyjs/gatsby.

Source

Thrown at packages/gatsby-source-wordpress/src/utils/fetch-graphql.ts:614

if ( defined( 'GRAPHQL_REQUEST' ) && true === GRAPHQL_REQUEST ) {
  return;
}\n\nYou can use the gatsby-source-wordpress debug options to determine which GraphQL request is causing this error.\nhttps://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-source-wordpress/docs/plugin-options.md#debuggraphql-object`
        ),
      },
    })

    return
  }

  const sharedEmptyStringReponseError = `\n\nAn empty string was returned instead of a response when making a GraphQL request.\nThis may indicate that you have a WordPress filter running which is causing WPGraphQL\nto return an empty string instead of a response.\nPlease open an issue with a reproduction at\nhttps://github.com/gatsbyjs/gatsby/issues/new\nfor more help\n\n${errorContext}\n`

  const emptyStringResponse =
    e.message === `GraphQL request returned an empty string.`

  if (emptyStringResponse) {
    reporter.log(``)
    if (process.env.NODE_ENV === `development`) {
      reporter.warn(formatLogMessage(sharedEmptyStringReponseError))
    } else {
      reporter.panic({
        id: CODES.BadResponse,
        context: {
          sourceMessage: formatLogMessage(sharedEmptyStringReponseError),
        },
      })

      return
    }

    return
  }

  if (e.message.includes(`self signed certificate`)) {
    reporter.panic({
      id: CODES.SelfSignedCert,
      context: {

View on GitHub (pinned to e85d62f177)

Solutions

  1. Disable WordPress filters/hooks that intercept GraphQL requests and return early (the docs point at `graphql_request`-style filters returning an empty string)
  2. Use the plugin's debug.graphql option to identify which request returns empty
  3. Check server error logs (PHP fatals can yield an empty body) and raise PHP memory/execution limits
  4. Open a GitHub issue with a reproduction if the cause can't be isolated
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/gatsby-source-wordpress/src/utils/fetch-graphql.ts:614 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26). Data as JSON: /api/errors/eafd5b1fe2b94265. Report an issue: GitHub.