In this video, we are going to populate the rare author above the comments and display it accordingly
as you see here.
So how are we going to get it done unless we get back to the API of the posts and let's see how we are
going to populate that.
So let's get back to post controller and this is the field for fetching single posts.
So this is where we have the user which is inside the command.
So for this we are going to use this special syntax so that we can pre populate the nested ID and that
is the user.
So here I'm going to use object and then the path for this is going to be command.
And inside the command we have a field called user, so going to be populate and then user.
The path for this is user.
All right, So let's save it and let's make the request.
Refresh it and let's check our console.
That is our terminal instead.
And you can see we have the user being populated with the object.
So now we can use the user foo name or user profile image.
So moment of truth.
So let's get back to the post details and this is where we are looping through.
So in here we have access to the user.
So let's go ahead and display the image.
Remember on the command, we have the user, as you saw inside the console going to be the comment.
Here we have the user and then the profile image of the user.
So save it and let's refresh it and let's see.
Let's click on continue reading.
And we have the image of the user.
You can see this is me that is a look in user.
If I go to my profile page, you can see that these are the posts that I've created.
And if I click on this one, you can see that indeed it belongs to me.
And it was me who added this comment.
So if I add one more comment and for this, let me add some dummy text here.
And create.
Suck six and let's refresh it and I have to comment.
So let me add the name also, and here I'm going to use this one.
And the name.
Sorry.
This one instead.
And it's going to be full name.
The date also.
And it's equal to the created at.
And I want to convert to low car date.
String.
All right, stats.
So let's refresh it.
And we have it as Emma.
Emma, if I look in as different person.
So let me look out and look in as Ben.
I think for Ben, I forgot the email.
Or the password.
One, two, three, four, five.
Let me see.
Well, invalid.
So let me register.
Different person asked from us.
So now let me go ahead and comment a post.
So I want to comment this post.
And I would say, let me copy.
And here.
Sux x refresh.
And you can see that I have the creator of the comment and the name and then the date.
And this is my comment.
All right.
So the next video let's go ahead and avoid by sending JSON data after a user has created a comment.