{"record":{"id":"5521d9f340899a5a","repo":"hasura/graphql-engine","slug":"typecheck-failed-for-field-field-name-in-object","errorCode":null,"errorMessage":"Typecheck failed for field {field_name:} in object type {object_type:}: {error:}","messagePattern":"Typecheck failed for field (.+?) in object type (.+?): (.+?)","errorType":"validation","errorClass":"TypecheckIssue","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/helpers/typecheck.rs","lineNumber":36,"sourceCode":"    },\n    #[error(\"Error in array item: {inner_error:}\")]\n    ArrayItemMismatch { inner_error: Box<TypecheckError> },\n    #[error(\"Expected an array but instead got value {value:}\")]\n    NonArrayValue { value: serde_json::Value },\n    #[error(\"Expected a non-null value but received null\")]\n    NullInNonNullableColumn,\n}\n\n#[derive(Error, Debug, PartialEq)]\n/// Issues that can occur when typechecking a value against an object type\npub enum TypecheckIssue {\n    #[error(\"Expected an object value of type {expected:} but got value {actual:}\")]\n    ObjectTypeMismatch {\n        expected: Qualified<CustomTypeName>,\n        actual: serde_json::Value,\n    },\n\n    #[error(\"Typecheck failed for field {field_name:} in object type {object_type:}: {error:}\")]\n    ObjectTypeField {\n        field_name: FieldName,\n        object_type: Qualified<CustomTypeName>,\n        error: TypecheckError,\n    },\n\n    #[error(\n        \"Found a literal value but the argument is a boolean expression type '{boolean_expression_type_name}'\"\n    )]\n    LiteralValueUsedForBooleanExpression {\n        boolean_expression_type_name: Qualified<CustomTypeName>,\n    },\n}\n\nimpl ShouldBeAnError for TypecheckIssue {\n    fn should_be_an_error(&self, flags: &open_dds::flags::OpenDdFlags) -> bool {\n        match self {\n            TypecheckIssue::ObjectTypeField { .. } | TypecheckIssue::ObjectTypeMismatch { .. } => {","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/helpers/typecheck.rs#L18-L54","documentation":"A TypecheckIssue that wraps a nested TypecheckError for one specific field of an object type, adding context: the field name, the object type it belongs to, and the underlying error. It lets you pinpoint which key inside an object literal failed typechecking.","triggerScenarios":"Typechecking an object-typed value where one field's value violates its declared type, e.g. {age: \"old\"} for an Int field, or a null in a non-null field.","commonSituations":"Wrong field value types in nested defaults, renamed or retyped object fields leaving stale metadata values, nulls in non-nullable subfields.","solutions":["Inspect the nested {error:} and fix the named {field_name:} in the literal","Align the field's value with the field's declared type in the object type definition","Re-run to check the remaining fields"],"exampleFix":"// before\ndefault:\n  age: \"thirty\"   # age: Int!\n\n// after\ndefault:\n  age: 30","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Field-level context is already attached; log field_name + object_type with the inner error:\nif let TypecheckIssue::ObjectTypeField { field_name, object_type, error } = issue {\n    eprintln!(\"{object_type:?}.{field_name}: {error}\");\n}","preventionTips":["Validate nested field values per-field in tests","Keep defaults in sync with object type field definitions","Use schema-driven form generation for object literals"],"tags":["metadata","typecheck","object-type","field"],"backgroundTag":"value-type-mismatch","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}