{"record":{"id":"f25f286fdfbba0fd","repo":"hasura/graphql-engine","slug":"unknown-fields-found-in-object-type-object-type-n","errorCode":null,"errorMessage":"Unknown fields found in object type {object_type_name}: {fields:?}","messagePattern":"Unknown fields found in object type (.+?): (.+?)","errorType":"validation","errorClass":"MapFieldNamesError","httpStatus":null,"severity":"error","filePath":"v3/crates/plan/src/query/arguments.rs","lineNumber":662,"sourceCode":"pub enum MapFieldNamesError {\n    #[error(\"Value did not match array type, was expecting {expected_type}\")]\n    ExpectedAnArray {\n        expected_type: QualifiedTypeReference,\n    },\n    #[error(\"Value did not match object type, was expecting {expected_type}\")]\n    ExpectedAnObject {\n        expected_type: QualifiedTypeReference,\n    },\n    #[error(\"Type mappings not found for object type {object_type_name}\")]\n    TypeMappingsNotFound {\n        object_type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\"Field mapping {field_name} not found for object type {object_type_name}\")]\n    FieldMappingNotFound {\n        object_type_name: Qualified<CustomTypeName>,\n        field_name: FieldName,\n    },\n    #[error(\"Unknown fields found in object type {object_type_name}: {fields:?}\")]\n    UnknownFieldsInObject {\n        object_type_name: Qualified<CustomTypeName>,\n        fields: Vec<String>,\n    },\n}\n\nimpl TraceableError for MapFieldNamesError {\n    fn visibility(&self) -> ErrorVisibility {\n        match self {\n            Self::ExpectedAnArray { .. }\n            | Self::ExpectedAnObject { .. }\n            | Self::UnknownFieldsInObject { .. } => ErrorVisibility::User,\n            Self::TypeMappingsNotFound { .. } | Self::FieldMappingNotFound { .. } => {\n                ErrorVisibility::Internal\n            }\n        }\n    }\n}","sourceCodeStart":644,"sourceCodeEnd":680,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/plan/src/query/arguments.rs#L644-L680","documentation":"MapFieldNamesError::UnknownFieldsInObject is a strict-mode style error: after mapping all recognized fields of an argument object, one or more fields were left over that have no mapping in the object's type mapping. The planner lists the unmapped field names rather than silently ignoring them, to prevent silent data loss.","triggerScenarios":"Sending extra fields in a nested argument object that are not declared in the type mapping's field_mappings — e.g. legacy fields removed from the schema, or client-side enrichment fields accidentally left in the payload.","commonSituations":"Client sending supersets of fields after schema pruning; version skew between old clients and new schemas; copy-pasted variable payloads with leftover keys; debug fields accidentally included.","solutions":["Remove the listed unknown fields from the argument object","Align the client payload with the current schema's field set for that object type","If the fields are legitimate, add them to the connector's field mappings / metadata","Add client-side validation (e.g. zod .strict()) to catch extra keys early"],"exampleFix":"// before\n{ \"where\": { \"id\": 1, \"debug\": true } }   // \"debug\" unknown\n// after\n{ \"where\": { \"id\": 1 } }","handlingStrategy":"validation","validationCode":"let known: HashSet<_> = mapping.field_mappings.keys().cloned().collect();\nlet extra: Vec<_> = value.keys().filter(|k| !known.contains(*k)).collect();\nassert!(extra.is_empty(), \"unknown fields: {extra:?}\");","typeGuard":"const stripUnknown = <T extends object>(v: T, known: string[]) => Object.fromEntries(Object.entries(v).filter(([k]) => known.includes(k)));","tryCatchPattern":"Catch UnknownFieldsInObject and echo the fields list back for quick client-side fixes.","preventionTips":["Use strict schema validators (zod .strict(), serde deny_unknown_fields) on variable payloads","Prune debug fields before sending","Version client payloads with the schema"],"tags":["rust","ndc","strict-validation","field-mapping","arguments"],"backgroundTag":"schema-validation-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}