gatsbyjs/gatsby · error

${r.errors.join(`, `)}

Error message

${r.errors.join(`, `)}

What it means

Thrown by gatsby-plugin-feed's runQuery helper when the GraphQL handler returns a response with a non-empty `errors` array. The helper joins all error strings into one message and throws, aborting feed generation for that query. It is the runtime counterpart to the plugin-options validation: a structurally valid query that the schema rejects at execution time.

Source

Thrown at packages/gatsby-plugin-feed/src/internals.js:4

export const runQuery = (handler, query) =>
  handler(query).then(r => {
    if (r.errors) {
      throw new Error(r.errors.join(`, `))
    }

    return r.data
  })

export const defaultOptions = {
  // Override if you want to manually specify the RSS "generator" tag.
  generator: `GatsbyJS`,

  // Run a default query to gather some information about the site.
  query: `
    {
      site {
        siteMetadata {
          title
          description
          siteUrl
          site_url: siteUrl

View on GitHub (pinned to 8b06340921)

Solutions

  1. Read the joined error string — it names the failing field/type.
  2. Run the same query in GraphiQL (`gatsby develop`) to reproduce and see full error locations.
  3. Align the feed query (or the `setup`/`feeds[].serialize`) with the current schema; rename removed fields.
  4. If using a custom query, verify every selected field resolves against your sourced nodes.

Example fix

// before: query selects a field that no longer exists
query: `{ allSitePage { totalCount } }`
// after: select an existing field
query: `{ allMarkdownRemark { totalCount } }`
Defensive patterns

Strategy: try-catch

Validate before calling

// dry-run the feed query against the schema before onPostBootstrap
const res = await runQuery(graphql, feedQuery)
if (!res) console.warn('feed query returned no data')

Type guard

const isErrorsResponse = (r: any): r is { errors: any[] } =>
  !!r && Array.isArray(r.errors) && r.errors.length > 0

Try / catch

try {
  const data = await runQuery(handler, query)
} catch (e) {
  if (/errors/i.test(e.message)) { /* fix schema/query, skip feed */ } else throw e
}

Prevention

When it happens

Trigger: Calling runQuery(handler, query) where the GraphQL execution returns { errors: [...] } — typically field does not exist, type mismatch, missing resolver, or unauthorized field on the site's schema. Happens during onPostBootstrap when the feed's default or custom query runs against the built schema.

Common situations: Customizing plugin-feed's `query` option to a field that does not exist on the user's schema; removing/renaming a sourced field that the feed query selects; version mismatch where siteAllPage/sitePage fields changed; a typo in a fragment name.

Related errors


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