gatsbyjs/gatsby · error
This query took more than 15s to run — which might indicate…
Error message
This query took more than 15s to run — which might indicate you're querying too much or have some unoptimized code:\nFile path: ${queryJob.componentPath} What it means
reportLongRunningQueryJob warns when a page/static/slice query ran longer than 15 seconds. This is a performance signal, not a failure: the query still completes, but it usually indicates an expensive query (deep connections, unfiltered lists) or slow source plugin code, and it can stall the overall build.
Solutions
- Narrow the GraphQL query with filters, limits, and fewer nested fields
- Add indexes/cache on the source side or use a faster source plugin
- Profile the query with `gatsby build --verbose` or QUERY_ROWS_LIMIT instrumentation; split heavy pages into slices
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/gatsby/src/query/query-runner.ts:50 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/abed90c4c23eb8f3.
Report an issue: GitHub.
Appendix: source
Thrown at packages/gatsby/src/query/query-runner.ts:50
hash?: string
query: string
componentPath: string
context: PageContext
queryType: "page" | "static" | "slice"
pluginCreatorId?: string
}
function reportLongRunningQueryJob(queryJob: IQueryJob): void {
const messageParts = [
`This query took more than 15s to run — which might indicate you're querying too much or have some unoptimized code:`,
`File path: ${queryJob.componentPath}`,
]
if (queryJob.queryType === `page`) {
messageParts.push(`URL path: ${queryJob.context.path}`)
}
report.warn(messageParts.join(`\n`))
}
function panicQueryJobError(
queryJob: IQueryJob,
errors: ReadonlyArray<GraphQLError>
): void {
let urlPath = undefined
let queryContext = {}
const plugin = queryJob.pluginCreatorId || `none`
if (queryJob.queryType === `page`) {
urlPath = queryJob.context.path
queryContext = queryJob.context.context
}
const structuredErrors = errors.map(e => {
const structuredError = errorParser({
message: e.message,View on GitHub (pinned to e85d62f177)