{"record":{"id":"1871e64b58586f79","repo":"hasura/graphql-engine","slug":"the-field-path-provided-in-the-location-of-the","errorCode":null,"errorMessage":"The field path provided in the {location:} of the relationship {relationship_name} on type {type_name} is empty","messagePattern":"The field path provided in the (.+?) of the relationship (.+?) on type (.+?) is empty","errorType":"validation","errorClass":"RelationshipError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/object_relationships/error.rs","lineNumber":157,"sourceCode":"        relationship_name: RelationshipName,\n        error: models::ModelsError, // ideally, this would return the more accurate\n                                    // `ModelAggregateExpressionError` instead\n    },\n    #[error(\n        \"The source field '{source_field_name}' of type '{source_field_type}' in the relationship '{relationship_name}' on type '{source_type}' cannot be mapped to the target argument '{target_argument_name}' of type '{target_argument_type}' on the target model '{target_model_name}' because their types are incompatible\"\n    )]\n    ModelArgumentTargetMappingTypeMismatch {\n        source_type: Qualified<CustomTypeName>,\n        relationship_name: RelationshipName,\n        source_field_name: FieldName,\n        source_field_type: QualifiedTypeReference,\n        target_model_name: Qualified<ModelName>,\n        target_argument_name: ArgumentName,\n        target_argument_type: QualifiedTypeReference,\n    },\n    #[error(\"Relationship mappings from value expressions are not supported yet.\")]\n    ValueExpressionMappingsNotSupportedYet,\n    #[error(\n        \"The field path provided in the {location:} of the relationship {relationship_name} on type {type_name} is empty\"\n    )]\n    EmptyFieldPath {\n        location: String,\n        relationship_name: RelationshipName,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\n        \"Model fields cannot be used in command based relationship: {relationship_name:} on type {type_name:}\"\n    )]\n    ModelFieldCannotBeUsedInCommandRelationship {\n        relationship_name: RelationshipName,\n        type_name: Qualified<CustomTypeName>,\n    },\n    #[error(\"Relationships with nested field paths are not supported yet.\")]\n    NestedFieldPathsNotSupportedYet,\n    #[error(\"{0}\")]\n    CommandError(#[from] commands::CommandsError),","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/object_relationships/error.rs#L139-L175","documentation":"A field path supplied in a relationship (the message says which location, e.g. source or target mapping) resolved to an empty list of path segments, which is meaningless and rejected.","triggerScenarios":"Providing an empty string field name or an empty field-path array in a relationship mapping (e.g. `field: \"\"` or `path: []`).","commonSituations":"Templating/automation generating metadata with empty placeholders; hand-written YAML leaving a blank field value.","solutions":["Locate the location named in the message and fill in a real field name/path","If the field is genuinely unused, remove the mapping entry entirely","Validate generated metadata for empty strings before applying"],"exampleFix":"// before\nfield_mappings:\n  - source: \"\"\n    target: { model: authors, field: id }\n// after\nfield_mappings:\n  - source: author_id\n    target: { model: authors, field: id }","handlingStrategy":"validation","validationCode":"for (const m of rel.field_mappings ?? []) {\n  if (!m.source || m.source.trim() === '') throw new Error('empty source field path');\n  if (!m.target?.field || m.target.field.trim() === '') throw new Error('empty target field path');\n}","typeGuard":null,"tryCatchPattern":"try { await applyMetadata(md); } catch (e) { if (/field path .* is empty/.test(e.message)) { /* fill or remove the empty path */ } throw e; }","preventionTips":["Fail template rendering on empty values instead of emitting empty strings","Lint metadata for blank field names before apply"],"tags":["metadata","relationships","field-path","validation"],"backgroundTag":"metadata-relationship-validation-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}