gatsbyjs/gatsby · error · Error
Can't determine type for "${value}" in `${selector}`.
Error message
Can't determine type for "${value}" in `${selector}`. What it means
Terminal fallback of getSimpleFieldConfig: after trying object/array/field-type inference branches for an example value, no inference rule matched, so the field's type cannot be determined from the sampled data at that selector path. Usually an empty value or an exotic type (e.g. null-only, Date, mixed) in the source data.
Source
Thrown at packages/gatsby/src/schema/infer/add-inferred-fields.js:381
const inferenceConfig = getInferenceConfig({
typeComposer: fieldTypeComposer,
defaults: config,
})
return {
type: addInferredFieldsImpl({
schemaComposer,
typeComposer: fieldTypeComposer,
exampleObject: value,
typeMapping,
prefix: selector,
unsanitizedFieldPath,
config: inferenceConfig,
}),
}
}
}
throw new Error(`Can't determine type for "${value}" in \`${selector}\`.`)
}
const createTypeName = selector => {
const keys = selector.split(`.`)
const suffix = keys.slice(1).map(_.upperFirst).join(``)
return `${keys[0]}${suffix}`
}
const NON_ALPHA_NUMERIC_EXPR = new RegExp(`[^a-zA-Z0-9_]`, `g`)
/**
* GraphQL field names must be a string and cannot contain anything other than
* alphanumeric characters and `_`. They also can't start with `__` which is
* reserved for internal fields (`___foo` doesn't work either).
*/
const createFieldName = key => {
// Check if the key is really a string otherwise GraphQL will throw.
invariant(View on GitHub (pinned to e85d62f177)
Solutions
- Ensure the field consistently contains values of one primitive type
- Add an explicit type definition (createTypes) for the field instead of relying on inference
- Normalize nulls/undefined out of the example data
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at packages/gatsby/src/schema/infer/add-inferred-fields.js:381 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/efb7b32f0c5cd8e3.
Report an issue: GitHub.