CaaS V3 resolve all references
Author: TimoMeister
Publication Date: 11/20/2024 12:58
We're considering the migration vom CaaS v2 to v3.
Is there a best practice to resolve all references (e.g. to images / documents) for a page? We know about the paramater "resolveRef", but in most of the cases we don't know the amount and the different depths of references.
As a page can have multiple images, we would like to have one and not multiple requests for a single page .
What is your approach to solve this?
-
Author: ChKo - 11/25/2024 8:29
Hi,
have you had a look at the GraphQL feature of CaaS? You can use it to resolve references:
https://docs.e-spirit.com/module/caas-platform/CaaS_Platform_Documentation_EN.html#graphql
0 -
Author: TimoMeister - 11/25/2024 11:46
Thanks for your reply. GraphQL is not an option. Our current solution/app is based on RestHeart and we don't want to change the whole technology.
0 -
Author: Peter_Jodeleit - 11/26/2024 16:33
If you don't want to use the resolveRef parameter or GraphQL, you can reduce the number of calls only to two. The first call gets the document with unresolved references. After collecting the references (IDs) on client side issue a second call which requests all IDs in one go.
This is eg how our Frontend library works.
0 -
Author: TimoMeister - 11/27/2024 14:29
Thanks Peter for your idea.
Is there any wildcard value possible for resolveRef? like resolveRef=[*].st_image.value.url or resolveRef=true?
0 -
Author: Peter_Jodeleit - 11/27/2024 15:15
Hi Timo,
no, wildcards are not supported (by intention).0
Please sign in to leave a comment.
Comments
5 comments