Search the FirstSpirit Knowledge Base
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?
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.
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
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.
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.
Thanks Peter for your idea.
Is there any wildcard value possible for resolveRef? like resolveRef=[*].st_image.value.url or resolveRef=true?
Hi Timo,
no, wildcards are not supported (by intention😉).