it helps some times The relation isn't there because you haven't loaded it. All it knows is the foreign key. It would be wildly inefficient if it grabbed all that information for you because it wouldn't always need all that. Think of instances where a single model could have many relationships, that would be many database calls for no reason. If you need the relation, you can use $post->category. Since the relation is not yet loaded, it will get it for you when you do this.
laravel eloquent relation one to many returns null
help you fix your problem In order to match up the eager loaded Products with the Incoming_goods, Laravel needs the foreign key to be selected. Since you did not include the foreign key (product_id) in the select list, Laravel can't match up the related records after retrieving them. So, all your product relationships will be empty. Add in the foreign key to the select list, and you should be good.
I think the issue was by ths following , This forum post helped me understand some caveat around Prisma client when it comes to resolvers. Help Understanding Prisma Client’s Value Proposition In my case I was missing the following revolvers because I thought they would be implied based on the schema relationship.