Invoke Graphql query from Adobe IO




Hello Team,


Can anyone help us on how to invoke a Graphql query from Adobe IO runtime environment.


Basically we are trying to build an api layer in Adobe io which acts as middle layer between magento and other consuming applications such as AEM.


Any reference invocation or Pseudo code will help.


@mhaack @Mihai_Corlan 

View Entire Topic




@mhaack -

We have extended the createCustomer in our resolvers and we are trying to call the magento and get the data as part of createCustomer call and return in as a response.
Our extended createCustomer entry point in cartResolver.js :

 createCustomer: (paramscontext=> {
            return new CreateCustomer({
From here we are calling a class with get customer method returning the response.
return new Promise(async function(resolve,reject){
let ou;
            try {
                output = await client.mutate({
                mutation: gql`mutation($email: String, $firstname: String, $lastname: String, $password: String) {
                    createCustomer(input: { email: $email, firstname: $firstname, lastname: $lastname, password: $password }) {
                        customer {

             if(output && && &&{
                 ou =;
So we are getting the response from Magento Client in our Node JS code. It's just that, when we are returning it from Adobe IO endpoint it becomes null during the call. If any static response it gets resolved properly.

For ex: If I resolved the below object then I get the output:
let object =
and when I add resolve(object) it gives me the proper response for create customer with static data:
    "data": {
        "createCustomer": {
            "customer": {
But when I pass the returned response from Magento directly it resolves null. Although it logs the data.