Skip to content
Latchkey

Gridsome "GraphQL" build error in CI

Gridsome builds an internal GraphQL data layer from source plugins, then runs page queries against it. A query that asks for a missing field or a collection that was not created fails gridsome build.

What this error means

gridsome build stops with a GraphQL error such as "Cannot query field X on type Y" or "Unknown type", naming a page component's <page-query>.

gridsome
GraphQL execution errors:
  Cannot query field "allBlogPost" on type "Query".

  in /home/runner/work/site/site/src/templates/Blog.vue

Common causes

A source plugin did not create the collection

The query targets a collection (allBlogPost) that the source plugin was supposed to add, but the plugin is missing or pointed at no content in CI.

A typename or field mismatch

The query uses a type or field name that differs from what the data layer generated, so resolution fails.

How to fix it

Ensure the source plugin creates the collection

  1. Confirm the source plugin is configured and points at existing content.
  2. Match the query's collection and field names to what the plugin generates.
  3. Re-run the build so the data layer includes the type.
gridsome.config.js
module.exports = {
  plugins: [{
    use: '@gridsome/source-filesystem',
    options: { typeName: 'BlogPost', path: 'content/blog/**/*.md' },
  }],
};

Inspect the schema before querying

Run the dev server's GraphQL explorer to confirm exact type and field names before relying on them in a build.

How to prevent it

  • Keep source plugin typeNames in sync with page queries.
  • Ensure content exists in the CI checkout so collections populate.
  • Verify field names against the generated schema.

Frequently asked questions

What causes ""GraphQL" build error (Gridsome)"?
The query targets a collection (allBlogPost) that the source plugin was supposed to add, but the plugin is missing or pointed at no content in CI.
How do I fix "GraphQL" build error (Gridsome)?
Ensure the source plugin creates the collection

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card