gatsbyjs/gatsby · error · Error

Invalid plugin options for "gatsby-plugin-feed": "query" mus

Error message

Invalid plugin options for "gatsby-plugin-feed":
"query" must be a valid GraphQL query. Received the error "${e.message}"

What it means

Plugin options schema for gatsby-plugin-feed: the required 'query' string is run through graphql parse in a Joi external check. A parse failure means the configured feed query is not syntactically valid GraphQL; the underlying parser message is embedded.

Source

Thrown at packages/gatsby-plugin-feed/src/plugin-options.js:19

import { parse } from "gatsby/graphql"
import { stripIndent } from "common-tags"

const feed = ({ Joi }) =>
  Joi.object({
    output: Joi.string().required(),
    query: Joi.string().required(),
    title: Joi.string().required(),
    serialize: Joi.func().required(),
    match: Joi.string(),
    link: Joi.string(),
  })
    .unknown(true)
    .external(({ query }) => {
      if (query) {
        try {
          parse(query)
        } catch (e) {
          throw new Error(
            stripIndent`
      Invalid plugin options for "gatsby-plugin-feed":
      "query" must be a valid GraphQL query. Received the error "${e.message}"`
          )
        }
      }
    })

export default ({ Joi }) =>
  Joi.object({
    generator: Joi.string(),
    query: Joi.string(),
    setup: Joi.func(),
    feeds: Joi.array().items(feed({ Joi })).required(),
  })
    .unknown(true)
    .external(({ query }) => {
      if (query) {

View on GitHub (pinned to e85d62f177)

Solutions

  1. Fix the GraphQL syntax in the query option of gatsby-plugin-feed
  2. Validate the query with GraphiQL against your site's schema
  3. Keep the query a static template literal
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/gatsby-plugin-feed/src/plugin-options.js:19 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/7882fd771c723fa6. Report an issue: GitHub.