{"record":{"id":"33a01dc3c265d7f6","repo":"gatsbyjs/gatsby","slug":"encountered-an-error-parsing-the-provided-graphql-33a01d","errorCode":null,"errorMessage":"Encountered an error parsing the provided GraphQL type definitions:\n${message}\n\n${frame}\n","messagePattern":"Encountered an error parsing the provided GraphQL type definitions:\n(.+?)\n\n(.+?)\n","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/schema/types/type-defs.js","lineNumber":37,"sourceCode":"    } catch (error) {\n      reportParsingError(error)\n    }\n  }\n  return typeOrTypeDef\n}\n\nconst reportParsingError = error => {\n  const { message, source, locations } = error\n\n  if (source && locations && locations.length) {\n    const { codeFrameColumns } = require(`@babel/code-frame`)\n\n    const frame = codeFrameColumns(\n      source.body,\n      { start: locations[0] },\n      { linesAbove: 5, linesBelow: 5 }\n    )\n    report.panic(\n      `Encountered an error parsing the provided GraphQL type definitions:\\n` +\n        message +\n        `\\n\\n` +\n        frame +\n        `\\n`\n    )\n  } else {\n    throw error\n  }\n}\n\n/**\n * Given a type definition, collects type names that should skip the inference process\n */\nconst typesWithoutInference = (typeNames = [], typeOrTypeDef) => {\n  if (typeof typeOrTypeDef === `string`) {\n    typeOrTypeDef = parseTypeDef(typeOrTypeDef)\n  }","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/schema/types/type-defs.js#L19-L55","documentation":"Fires from reportParsingError when SDL passed to createTypes fails GraphQL parsing: the panic includes the parser message and a code frame (5 lines above/below) around the first offending location in the type definition string.","triggerScenarios":"Thrown at packages/gatsby/src/schema/types/type-defs.js:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the invalid GraphQL SDL syntax at the flagged location in the type definitions passed to createTypes"],"exampleFix":null,"handlingStrategy":"try-catch","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"}