A
A
Arthur2019-09-07 13:08:12
JavaScript
Arthur, 2019-09-07 13:08:12

Data transformation from API or new endpoint?

Hello everyone, tell me
Is there an API for getting users.
There is an API to get all the posts left by users.
The task is to display users and their posts.
How to do it right?:
1. We make a separate request for users on the client and a separate request for posts. Matching users and posts. We derive.
2. Or is it better to create a new endpoint with getting the connection User+posts right away and not do any transformations on the client?
By what means there are transformations if they occur on the client? (Handles or any special binding tools?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2019-09-07
@cloudz

To solve this problem, GraphQL was born on Facebook in due time) maybe worth a try? I was very inspired by them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question