{"record":{"id":"601ced095fcf3f61","repo":"gatsbyjs/gatsby","slug":"illegal-type-definition-json-stringify-type-con","errorCode":null,"errorMessage":"Illegal type definition: ${JSON.stringify(type.config)}","messagePattern":"Illegal type definition: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/schema/schema.js","lineNumber":736,"sourceCode":"              }\n            })\n          } else {\n            return []\n          }\n        },\n      })\n      break\n    }\n    case GatsbyGraphQLTypeKind.ENUM: {\n      typeComposer = EnumTypeComposer.createTemp(type.config)\n      break\n    }\n    case GatsbyGraphQLTypeKind.SCALAR: {\n      typeComposer = ScalarTypeComposer.createTemp(type.config)\n      break\n    }\n    default: {\n      report.warn(`Illegal type definition: ${JSON.stringify(type.config)}`)\n      typeComposer = null\n    }\n  }\n  if (typeComposer) {\n    // Workaround for https://github.com/graphql-compose/graphql-compose/issues/311\n    typeComposer.schemaComposer = schemaComposer\n  }\n  return typeComposer\n}\n\nconst addSetFieldsOnGraphQLNodeTypeFields = ({ schemaComposer, parentSpan }) =>\n  Promise.all(\n    Array.from(schemaComposer.values()).map(async tc => {\n      if (tc instanceof ObjectTypeComposer && tc.hasInterface(`Node`)) {\n        const typeName = tc.getTypeName()\n        const result = await apiRunner(`setFieldsOnGraphQLNodeType`, {\n          type: {\n            name: typeName,","sourceCodeStart":718,"sourceCodeEnd":754,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/schema/schema.js#L718-L754","documentation":"This is a generic guard in createTypeComposerFromGatsbyType: the switch over GatsbyGraphQLTypeKind received a kind it does not handle (OBJECT, UNION, INTERFACE, ENUM, SCALAR are handled), so the input GatsbyGraphQLType config is unsupported or malformed and null is returned instead of a type composer.","triggerScenarios":"Thrown at packages/gatsby/src/schema/schema.js:736 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the type passed to createTypes was built with buildObjectType/buildUnionType/buildInterfaceType etc., not an unsupported kind","Fix the type definition so it uses a supported GatsbyGraphQLTypeKind","If passing plain SDL strings, ensure the SDL parses into a supported type"],"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"}