Resolver returns differently for invoke vs invoke-local

Not sure if this is a bug but sure is confusing:

Returning in a resolver like
return { data: { data: { success: true, message: "Created units successfully" }, errors: null } }

Testing invoke from command line:
{"data":{"success":true,"message":"Created units successfully"},"errors":null}

Testing invoke-local from command line:
Result: { "data": { "data": { "success": true, "message": "Created units successfully" }, "errors": null } }

invoke-local returns the data exactly as I return it from my function, while invoke seems to need me to return a wrapped response, and it picks off the value from the data key.

If this was going to be standardised, I prefer the invoke-local version - just feels cleaner not having to wrap the response inside another object.

Note that I just updated to CLI version 0.0.90 before posting to check that this behaved the same in the latest version.

Hello @samwoolertonLW!

Thank you for the feedback! We will fix invoke command response.

And also, I guess, you can avoid “data” wrapping, because it’s only cli’s invoke issue. The response itself is fine and contains the first “data” level.


@samwoolertonLW It is fixed now. Please update to latest CLI version. Thanks!

1 Like