{"record":{"id":"a8056881f78af9d3","repo":"gatsbyjs/gatsby","slug":"your-graphql-query-in-createpages-took-totalms","errorCode":null,"errorMessage":"Your GraphQL query in createPages took ${totalMS / 1000} seconds which is an unexpectedly long time. See https://gatsby.dev/create-pages-performance for tips on how to improve this.","messagePattern":"Your GraphQL query in createPages took (.+?) seconds which is an unexpectedly long time\\. See https://gatsby\\.dev/create-pages-performance for tips on how to improve this\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/services/create-pages.ts","lineNumber":40,"sourceCode":"  assertStore(store)\n  const activity = reporter.activityTimer(`createPages`, {\n    parentSpan,\n  })\n  activity.start()\n  const timestamp = Date.now()\n  const currentPages = new Map<string, IGatsbyPage>(store.getState().pages)\n\n  // Wrap the GraphQL function so we can measure how long it takes to run.\n  const originalGraphQL = gatsbyNodeGraphQLFunction\n  // eslint-disable-next-line\n  async function wrappedGraphQL() {\n    const start = Date.now()\n    // @ts-ignore not sure how to type the following\n    const returnValue = await originalGraphQL.apply(this, arguments) // eslint-disable-line\n    const end = Date.now()\n    const totalMS = end - start\n    if (totalMS > 10000) {\n      reporter.warn(\n        `Your GraphQL query in createPages took ${\n          totalMS / 1000\n        } seconds which is an unexpectedly long time. See https://gatsby.dev/create-pages-performance for tips on how to improve this.`\n      )\n    }\n    return returnValue\n  }\n\n  createPagesCount += 1\n  const traceId = isInitialCreatePages\n    ? `initial-createPages`\n    : `createPages #${createPagesCount}`\n  await apiRunnerNode(\n    `createPages`,\n    {\n      graphql: wrappedGraphQL,\n      traceId,\n      waitForCascadingActions: true,","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/services/create-pages.ts#L22-L58","documentation":"Error \"Your GraphQL query in createPages took ${totalMS / 1000} seconds which is an unexpectedly long time. See https://gatsby.dev/create-pages-performance for tips on how to improve this.\" thrown in gatsbyjs/gatsby.","triggerScenarios":"Thrown at packages/gatsby/src/services/create-pages.ts:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Follow https://gatsby.dev/create-pages-performance: reduce the amount of data queried in createPages","Paginate or filter queries instead of fetching all nodes at once","Move expensive work out of createPages into onPreBuild or async work outside the critical path","Profile the wrappedGraphQL timing to find the specific slow query in gatsby-node.js"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}