code: private function buildResponse($data)
      {
          if ($this->isPromise($data)) {
              return $data->then(function ($resolved) {
                  return $this->buildResponse($resolved);
              });
          }
          if ($data !== null) {
              $data = (array) $data;
          }
  
          return new ExecutionResult($data, $this->exeContext->errors);
      }
docs: @param mixed|Promise|null $data
  
  @return ExecutionResult|Promise