Try to delete var recipe: Recipe? = nil and inverse: \FoodMenu.recipe, it should be fixed.
Unlike CoreData, SwiftData simplifies the declarations. Just need to add var menus: [FoodMenu]? with @Relationship(deleteRule: .cascade).
Post
Replies
Boosts
Views
Activity
Same here, I have to remove the inverse in one-to-many case. Looks like it's a bug in SwiftData since CoreData's behavior confirms the necessity of the inverse.