gatsbyjs/gatsby · error
Multiple node fields resolve to the same GraphQL field `${pr
Error message
Multiple node fields resolve to the same GraphQL field `${prefix}.${field.key}` - [${possibleFieldsNames}]. Gatsby will use `${field.unsanitizedKey}`. What it means
During schema inference (addInferredFieldsImpl), multiple node fields map to the same sanitized GraphQL field name (e.g. `someField` and `some_field` both become someField). Gatsby picks one representative value via resolveMultipleFields, warns which candidates existed and which unsanitized key was chosen, and proceeds — the other fields' values may be unrepresented in the schema.
Source
Thrown at packages/gatsby/src/schema/infer/add-inferred-fields.js:79
const key = createFieldName(unsanitizedKey)
fields.push({
key,
unsanitizedKey,
exampleValue: exampleObject[unsanitizedKey],
})
})
const fieldsByKey = _.groupBy(fields, field => field.key)
Object.keys(fieldsByKey).forEach(key => {
const possibleFields = fieldsByKey[key]
let selectedField
if (possibleFields.length > 1) {
const field = resolveMultipleFields(possibleFields)
const possibleFieldsNames = possibleFields
.map(field => `\`${field.unsanitizedKey}\``)
.join(`, `)
report.warn(
`Multiple node fields resolve to the same GraphQL field \`${prefix}.${field.key}\` - [${possibleFieldsNames}]. Gatsby will use \`${field.unsanitizedKey}\`.`
)
selectedField = field
} else {
selectedField = possibleFields[0]
}
const fieldConfig = getFieldConfig({
...selectedField,
schemaComposer,
typeComposer,
prefix,
unsanitizedFieldPath,
typeMapping,
config,
})
if (!fieldConfig) returnView on GitHub (pinned to e85d62f177)
Solutions
- Rename conflicting source fields so they sanitize to distinct GraphQL names
- Add explicit field inference (@infer/@dontInfer or explicit type definitions in createSchemaCustomization) to control resolution
- Normalize source data keys (e.g. camelCase everything) in the source plugin
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at packages/gatsby/src/schema/infer/add-inferred-fields.js:79 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/7e3f89d7a4de95b8.
Report an issue: GitHub.