gatsbyjs/gatsby · error

112002

112002

Error message

${errorContext ? `${errorContext}` : ``}\n\nThe supplied url ${bold(urlWithoutTrailingSlash)} is invalid,\nhowever ${bold(urlWithoutTrailingSlash + `/graphql`)} works!\n\nFor this plugin to consume the wp-graphql schema, you'll need to specify the full URL\n(${bold(urlWithoutTrailingSlash + `/graphql`)}) in your gatsby-config.

What it means

Error "${errorContext ? `${errorContext}` : ``}\n\nThe supplied url ${bold(urlWithoutTrailingSlash)} is invalid,\nhowever ${bold(urlWithoutTrailingSlash + `/graphql`)} works!\n\nFor this plugin to consume the wp-graphql schema, you'll need to specify the full URL\n(${bold(urlWithoutTrailingSlash + `/graphql`)}) in your gatsby-config." thrown in gatsbyjs/gatsby.

Source

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

    try {
      const urlWithoutTrailingSlash = url.replace(/\/$/, ``)

      const response: AxiosResponse = await moduleHelpers
        .getHttp(limit)
        .post(
          `${urlWithoutTrailingSlash}/graphql`,
          { query, variables },
          requestOptions
        )

      const contentType = response?.headers[`content-type`]

      if (contentType?.includes(`application/json;`)) {
        const docsLink = `https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-source-wordpress/docs/plugin-options.md#url-string`

        // if adding `/graphql` works, panic with a useful message
        reporter.panic({
          id: CODES.MissingAppendedPath,
          context: {
            sourceMessage: formatLogMessage(
              `${
                errorContext ? `${errorContext}` : ``
              }\n\nThe supplied url ${bold(
                urlWithoutTrailingSlash
              )} is invalid,\nhowever ${bold(
                urlWithoutTrailingSlash + `/graphql`
              )} works!\n\nFor this plugin to consume the wp-graphql schema, you'll need to specify the full URL\n(${bold(
                urlWithoutTrailingSlash + `/graphql`
              )}) in your gatsby-config.\n\nYou can learn more about configuring the source plugin URL here:\n${docsLink}\n\n`
            ),
          },
        })

        return
      }

View on GitHub (pinned to 8b06340921)

Solutions

  1. Update the url option in gatsby-config.js to the full WPGraphQL endpoint including /graphql (the logged working URL).

When it happens

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

Common situations: Occurs when the configured WordPress URL lacks the /graphql endpoint path. Set the url option in gatsby-config.js to the full WPGraphQL endpoint, e.g. https://example.com/graphql.


AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13). Data as JSON: /api/errors/6b52b3af2c1d6f49. Report an issue: GitHub.