Hello.
Short description: asynchronuous query doesn't wait dependent async transformers to be resolved, sending incomplete HTTP request.
Explanation:
When I have API Query getProductsQuery
, that has Authorization
header with the following value Bearer {{ getAccessTokenAsyncronouslyTransofrmer.value }}
, and getAccessTokenAsyncronouslyTransofrmer
is a Transformer with the following body:
return {{ urlparams.accessToken || generateAccessToken.data.accessToken }};
then the getProductsQuery
is executed on page load but with empty Bearer
header value. It doesn't wait when getAccessTokenAsyncronouslyTransofrmer
resolves.
Then, after generateAccessToken
is asyncronously finished, getProductsQuery
is re-exececuted again because input parameters have changed.
So if we look into the query log, it will be the following:
getProductsQuery
- failed because header has emptyBearer
tokengenerateAccessToken
- successgetProductsQuery
- success. It's triggered because input has changed, and nowBearer XXX
has the correct value from transformer.
Quetions: why in the point 1 getProductsQuery
doesn't wait resolving value from transformer?