{"record":{"id":"788e62cde2840231","repo":"gatsbyjs/gatsby","slug":"111001","errorCode":"111001","errorMessage":"${e.message}\\n\\n${errorContext}\\n\\nThis can happen due to custom code or redirection plugins which redirect the request when a post is accessed.\\nThis redirection code will need to be patched to not run during GraphQL requests.","messagePattern":"(.+?)\\\\n\\\\n(.+?)\\\\n\\\\nThis can happen due to custom code or redirection plugins which redirect the request when a post is accessed\\.\\\\nThis redirection code will need to be patched to not run during GraphQL requests\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-source-wordpress/src/utils/fetch-graphql.ts","lineNumber":467,"sourceCode":"\n  if (forbidden) {\n    reporter.panic({\n      id: CODES.RequestDenied,\n      context: {\n        sourceMessage: formatLogMessage(\n          `${e.message}\\n\\nThe GraphQL request was forbidden.\\nIf you are using a security plugin like WordFence or a server firewall you may need to add your IP address to the allow list or adjust your firewall settings for your GraphQL endpoint.\\n\\n${errorContext}`\n        ),\n      },\n    })\n\n    return\n  }\n\n  const redirected = e.message.includes(`GraphQL request was redirected`)\n\n  if (redirected) {\n    await handleErrorOptions({ variables, query, pluginOptions, reporter })\n    reporter.panic({\n      id: CODES.WordPressFilters,\n      context: {\n        sourceMessage: formatLogMessage(\n          `${e.message}\\n\\n${errorContext}\\n\\nThis can happen due to custom code or redirection plugins which redirect the request when a post is accessed.\\nThis redirection code will need to be patched to not run during GraphQL requests.\\n\\nThat can be achieved by adding something like the following to your WP PHP code:\\n\nif ( defined( 'GRAPHQL_REQUEST' ) && true === GRAPHQL_REQUEST ) {\n  return examplePreventRedirect();\n}\n\n${slackChannelSupportMessage}`\n        ),\n      },\n    })\n\n    return\n  }\n\n  const responseReturnedHtml =\n    !!response?.headers[`content-type`].includes(`text/html;`)","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-source-wordpress/src/utils/fetch-graphql.ts#L449-L485","documentation":"Error \"${e.message}\\n\\n${errorContext}\\n\\nThis can happen due to custom code or redirection plugins which redirect the request when a post is accessed.\\nThis redirection code will need to be patched to not run during GraphQL requests.\" thrown in gatsbyjs/gatsby.","triggerScenarios":"Thrown at packages/gatsby-source-wordpress/src/utils/fetch-graphql.ts:467 when the library encounters an invalid state.","commonSituations":"Occurs when a WordPress redirect plugin or custom code redirects GraphQL requests. Patch the redirection logic so it does not run for GraphQL requests.","solutions":["Find the custom code or redirection plugin that redirects the request and patch it to not run during GraphQL requests.","Guard redirects with a check for the GraphQL endpoint path or the WPGraphQL request context."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}