You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we iterate over the entity tags collection ($article->getTags()), each iteration makes an API call to retrieve the tag entity:
GET https://api/tags/331a2c47-164a-11e7-8a8a-f23c9124c2b0
GET https://api/tags/331a658c-164a-11e7-8a8a-f23c9124c2b0
GET https://api/tags/331a71cc-164a-11e7-8a8a-f23c9124c2b0
GET https://api/tags/9c828580-164a-11e7-8a8a-f23c9124c2b0
...
Which kills the performances of our application.
Embedding the tags in the article API response is not an option in our case (for a lot of reasons).
So my question is: is there a way to tell the API client to retrieve all the tags at once instead of retrieving them one by one ?
The text was updated successfully, but these errors were encountered:
The fact is that the implementation of how you fetch all you calls is really depending on our architecture.
You may have a route like this: /tags/t1,t2,t3 which will make a "get" on tags t1, t2 and t3.
But you can also have a route like this: /tags?article=a1 with will list all tag with the tag serialization for article a1.
You may also have a route like this /articles/a1/tags !
At Mapado, we choose the second option (/tags?article=...), but in those case we can not use the automatic getter, we need to explicitly make 2 calls, one on /article/a1 and one for the tags /tags?article=a1
Hi,
we encounter performance issues with related entities.
Given we make this API call:
GET https://api/articles/12345678-4792-11e7-88db-f23c9124c2b0
Which returns :
When we iterate over the entity tags collection (
$article->getTags()
), each iteration makes an API call to retrieve the tag entity:Which kills the performances of our application.
Embedding the tags in the article API response is not an option in our case (for a lot of reasons).
So my question is: is there a way to tell the API client to retrieve all the tags at once instead of retrieving them one by one ?
The text was updated successfully, but these errors were encountered: