Forge Containers: invokeService requires 'body: string'?

For the Forge Containers the ‘invokeService’, the body argument has a type ‘unknown’, and the documentation states that it must be a JSON.
This aligns with other similar calls, like invokeRemove

However, in practise it seems that it must be String JSON formatted. At least when using the forge tunnel and proxy-sidecar.

If we try to send a JSON object over it, I see the JSON object in the GraphQL call, like I expect. However, at the proxy-sidecar level a [object Object] arrives. When I send the body as a String with JSON in it, then at the proxy-sidecar the JSON inside of that String arrives.

This looks to me like a bug? Or it needs way more explicit documentation that this body must be a String with JSON in it.

Hi @RomanStoffel

Thanks for reporting this. The team is taking a look!

Not really related, but:

invokeService also works to invoke Forge remotes. We did it by accident and never noticed. So, there might be apps that rely on this behavior that invokeSevice works for Forge Containers and Forge Remotes!

It’s actually nice that it works for both, if your app has a flavor based of Forge Remotes (public cloud) and Forge Containers (Isolated Cloud). Because as far as I know there is not appID or something like that in the context that let’s you switch to the ‘right’ call.

A fix to the docs is in the works. The correct/intended behaviour is that the body is a string containing JSON.