Hello there!
I have this query paymets to get all the payments for the user, the object has a connectin with student.
When I render the payments I have the id of the student, but I need the rest of the fields.
I don’t want to fetch again for the data that it’s already in the cache.
So, how to connect the id of the student inside the payments query ?
query payments{
id
...restOfData
student {
id
}
}
query allStudents {
id
name
email
}
The render in React:
return data.payments.map((aPayment) => {
return(
<div>
// Render RestOfData for each Payment.
// Inside this map I have the id of the student, and need to access the rest of the fields.
</div>
);
});
I have this pattern all over the app.