TimoMeister
Returning Responder

CaaS V3 resolve all references

Jump to solution

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?

0 Kudos
1 Solution

Accepted Solutions
Peter_Jodeleit
Crownpeak employee

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.

Peter

View solution in original post

0 Kudos
5 Replies
ChKo
Elite Observer

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 Kudos
TimoMeister
Returning Responder

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 Kudos
Peter_Jodeleit
Crownpeak employee

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.

Peter
0 Kudos
TimoMeister
Returning Responder

Thanks Peter for your idea. 

Is there any wildcard value possible for resolveRef? like resolveRef=[*].st_image.value.url or resolveRef=true?

0 Kudos
Peter_Jodeleit
Crownpeak employee

Hi Timo,

no, wildcards are not supported (by intention😉).

Peter
0 Kudos