{"record":{"id":"8a7a18a4dba3b683","repo":"gatsbyjs/gatsby","slug":"building-schema-failed","errorCode":null,"errorMessage":"Building schema failed","messagePattern":"Building schema failed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"packages/gatsby/src/schema/infer/index.js","lineNumber":61,"sourceCode":"      typeComposer.setExtension(`createdFrom`, `inference`)\n      typesToInfer.push(typeComposer)\n    }\n  })\n\n  if (noNodeInterfaceTypes.length > 0) {\n    noNodeInterfaceTypes.forEach(typeName => {\n      report.warn(\n        `Type \\`${typeName}\\` declared in \\`createTypes\\` looks like a node, ` +\n          `but doesn't implement a \\`Node\\` interface. It's likely that you should ` +\n          `add the \\`Node\\` interface to your type def:\\n\\n` +\n          `\\`type ${typeName} implements Node { ... }\\`\\n\\n` +\n          `If you know that you don't want it to be a node (which would mean no ` +\n          `root queries to retrieve it), you can explicitly disable inference ` +\n          `for it:\\n\\n` +\n          `\\`type ${typeName} @dontInfer { ... }\\``\n      )\n    })\n    report.panic(`Building schema failed`)\n  }\n\n  return typesToInfer.map(typeComposer =>\n    addInferredType({\n      schemaComposer,\n      typeComposer,\n      typeConflictReporter,\n      typeMapping,\n      parentSpan,\n      inferenceMetadata,\n    })\n  )\n}\n\nconst addInferredType = ({\n  schemaComposer,\n  typeComposer,\n  typeConflictReporter,","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby/src/schema/infer/index.js#L43-L79","documentation":"Gatsby panics during schema inference when one or more types declared via createTypes look like node types (i.e. they would normally be inferred as nodes) but do not implement the Node interface. The preceding warning messages list each offending type name and suggest adding `implements Node` or `@dontInfer`. This is a hard schema-construction failure.","triggerScenarios":"Calling actions.createTypes with a type like `type MyType { title: String }` where Gatsby's inference heuristics detect the type should be a node, but the type definition omits `implements Node`. The noNodeInterfaceTypes array is populated upstream when inferred types lack the Node interface.","commonSituations":"A plugin or gatsby-node.js defines a custom type via createTypes that resembles a node (fields like id, common node shapes) without `implements Node`. Migrating from older Gatsby versions where this was silently tolerated. Copy-pasting a type definition from docs that omitted the interface.","solutions":["Add `implements Node` to each type listed in the preceding warning: `type MyType implements Node { ... }`.","If the type is intentionally not a node, add the `@dontInfer` directive: `type MyType @dontInfer { ... }`.","Search your codebase and all plugins for createTypes calls referencing the listed type names and correct the definitions."],"exampleFix":"// before\ntype MyType {\n  title: String\n}\n\n// after\ntype MyType implements Node {\n  title: String\n}\n\n// or, if not a node:\ntype MyType @dontInfer {\n  title: String\n}","handlingStrategy":"validation","validationCode":"// Validate type defs before passing to createTypes\nconst { parse } = require('graphql')\nconst typeDefs = `\n  type MyType {\n    title: String\n  }\n`\n// Check: if type looks like a node, it must implement Node\nconst looksLikeNode = /type\\s+\\w+\\s*\\{/.test(typeDefs)\nconst implementsNode = /implements\\s+.*Node/.test(typeDefs)\nconst hasDontInfer = /@dontInfer/.test(typeDefs)\nif (looksLikeNode && !implementsNode && !hasDontInfer) {\n  console.warn('Type may need implements Node or @dontInfer')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always add implements Node to types that represent top-level data entities.","Use @dontInfer explicitly when a type is intentionally not a node.","Review all createTypes calls after adding or modifying type definitions."],"tags":["graphql","schema","createtypes","node-interface"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}