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>.
GraphQL execution errors:
Cannot query field "allBlogPost" on type "Query".
in /home/runner/work/site/site/src/templates/Blog.vueCommon 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
- Confirm the source plugin is configured and points at existing content.
- Match the query's collection and field names to what the plugin generates.
- Re-run the build so the data layer includes the type.
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.