@function executeRelatedResultResolve

execute queries for related models specified by resolve

@param {object} result

@returns {Promise}
554449
function executeRelatedResultResolve (result) {
    // skip if resolve not specified
    if (!this.args.resolve) {
        return
    }
    // create new resolve instance
    var resolve = new ImmutableCoreModelResolve({
        query: this,
        result: result,
    })
    // exceute resolve
    return resolve.resolve()
}
589384
function resolve_scalar_value(nextql, value, valueQuery, info) {
	if (value == undefined) {
		set(info.result, info.path, null);
		return Promise.resolve();
	}

	if (valueQuery !== 1) {
		const keylen = Object.keys(valueQuery).length;
		const queryAsObject = valueQuery.$params ? keylen > 1 : keylen > 0;
		if (queryAsObject) {
			return Promise.reject(
				new NextQLError("Cannot query scalar as object", info)
			);
		}
	}

	if (isPrimitive(value)) {
		set(info.result, info.path, value);
		return Promise.resolve();
	}

	// non-primitive value as scalar, not good solution yet
	try {
		set(info.result, info.path, JSON.parse(JSON.stringify(value)));
		return Promise.resolve();
	} catch (e) {
		return Promise.reject(
			new NextQLError("Cannot serialize return value", info)
		);
	}
}
687757
function resolve (accumulator, resolveReducer) {
  // get Entity Spec
  const spec = accumulator.reducer.spec
  // execute lodash template against
  // accumulator value
  const value = spec.template(accumulator.value)
  // set new accumulator.value
  // this method creates a new acc object
  return Object.assign({}, accumulator, {
    value
  })
}
1349388
function resultModelView (results) {
    // build result with ModelViewEngine
    var viewResultPromise = this.modelViewEngine.result(results)
    // if query has view cache the cache view result
    if (defined(this.cache) && this.cache.view) {
        // and handler to cache result
        viewResultPromise.then(viewResults => this.cache.cacheResults(viewResults))
    }
    // return view result promise - do not wait for cache
    return viewResultPromise
}
757944
function final(err,result){
			if (err){return res.status(404).send(err)};
			var mts = process.rapidcfg.mdb.esqls[req.body.queryname];
			mts.inuse = true;
			process.rapidcfg.mdb.sqls[req.body.queryname] = mts;
			delete process.rapidcfg.mdb.esqls[req.body.queryname] //delete ;
			//console.log(process.rapidcfg.mdb.sqls);
			return res.send({message:"OK",result:result});
		}
304734
function resolveReducer (manager, accumulator, reducer) {
  // this conditional is here because BaseEntity#resolve
  // does not check that lifecycle methods are defined
  // before trying to resolve them
  if (!reducer) {
    return Promise.resolve(accumulator)
  }

  const isTracing = accumulator.trace

  const acc = isTracing
    ? trace.augmentAccumulatorTrace(accumulator, reducer)
    : accumulator

  const traceNode = acc.traceNode

  const resolve = getResolveFunction(reducer)

  // NOTE: recursive call
  let result = resolve(manager, resolveReducer, acc, reducer)

  if (hasDefault(reducer)) {
    const _default = reducer[DEFAULT_VALUE].value
    const resolveDefault = reducers.ReducerDefault.resolve
    result = result.then(acc => resolveDefault(acc, _default))
  }

  if (isTracing) {
    result = result.then(trace.augmentTraceNodeDuration(traceNode))
  }

  return result
}
1306422
function onSuccess(result) {
            const datastoreEntity = result ? result[0] : null;

            if (!datastoreEntity) {
                if (_this.gstore.config.errorOnEntityNotFound) {
                    const error = new Error('Entity not found');
                    error.code = errorCodes.ERR_ENTITY_NOT_FOUND;
                    throw error;
                }

                return null;
            }

            _this.entityData = datastoreEntity;
            return _this;
        }
1207290
function process_endpoint_result(raw_result) {
                const store_result = op.execute_on_store(raw_result);
                const result = NOOP === store_result
                    ? raw_result
                    : store_result
                    ;
                return resolve_promise(prepare_result(result));
            }
833592
def related_results(self):
        
        return bind_api(
            api=self,
            path='/related_results/show/{id}.json',
            payload_type='relation', payload_list=True,
            allowed_param=['id'],
            require_auth=False
        )
110940
function chain(promise,
               onResolve = idResolveHandler,
               onReject = idRejectHandler) {
  var deferred = getDeferred(promise.constructor);
  switch (promise.status_) {
    case undefined:
      throw TypeError;
    case 0:
      promise.onResolve_.push(onResolve, deferred);
      promise.onReject_.push(onReject, deferred);
      break;
    case +1:
      promiseEnqueue(promise.value_, [onResolve, deferred]);
      break;
    case -1:
      promiseEnqueue(promise.value_, [onReject, deferred]);
      break;
  }
  return deferred.promise;
}
613562
function resolve (manager, resolveReducer, accumulator, reducer) {
  const entity = manager.entities.get(reducer.id)
  return BaseEntity.resolve(
    manager,
    resolveReducer,
    accumulator,
    reducer,
    entity
  )
}
1361257
public function eagerlyResult(&$result, $relation, $subRelation, $closure)
    {
        $pk = $result->getPk();

        if (isset($result->$pk)) {
            $pk   = $result->$pk;
            $data = $this->eagerlyMorphToOne([
                [$this->morphKey, '=', $pk],
                [$this->morphType, '=', $this->type],
            ], $relation, $subRelation, $closure);

            if (isset($data[$pk])) {
                $relationModel = $data[$pk];
                $relationModel->setParent(clone $result);
                $relationModel->isUpdate(true);
            } else {
                $relationModel = null;
            }

            $result->setRelation(Db::parseName($relation), $relationModel);
        }
    }
825034
function optionalResolve(options) {
    setupOptions(options);
    return new Promise(function (res, rej) {
        if (options.resolve)
            loopReferences(options, res, rej)
        else
            res(options);
    });
}
457286
protected<Q> Q execute(RelationCategory returnType, ResultConstructor<Q> resultConstructor) {
        BaseVertexCentricQuery bq = super.constructQuery(returnType);
        if (bq.isEmpty()) return resultConstructor.emptyResult();
        if (returnType==RelationCategory.PROPERTY && hasSingleType() && !hasQueryOnlyLoaded()
                && tx.getConfiguration().hasPropertyPrefetching()) {
            //Preload properties
            vertex.query().properties().iterator().hasNext();
        }

        if (isPartitionedVertex(vertex) && !hasQueryOnlyGivenVertex()) { //If it's a preloaded vertex we shouldn't preload data explicitly
            List<InternalVertex> vertices = allRequiredRepresentatives(vertex);
            profiler.setAnnotation(QueryProfiler.PARTITIONED_VERTEX_ANNOTATION,true);
            profiler.setAnnotation(QueryProfiler.NUMVERTICES_ANNOTATION,vertices.size());
            if (vertices.size()>1) {
                for (BackendQueryHolder<SliceQuery> sq : bq.getQueries()) {
                    tx.executeMultiQuery(vertices, sq.getBackendQuery(),sq.getProfiler());
                }
            }
        } else profiler.setAnnotation(QueryProfiler.NUMVERTICES_ANNOTATION,1);
        return resultConstructor.getResult(vertex,bq);
    }
1269908
function (result) {
    // update status
    me.resolved = true;
    me.rejected = false;
    me.pending = false;

    _onSuccess.forEach(function (fn) {
      fn(result);
    });

    _process = function (onSuccess, onFail) {
      onSuccess(result);
    };

    _resolve = _reject = function () { };

    return me;
  }
323901
function handlePromise(query, q, model, resultsPerPage) {
  return Promise.all([
    query.exec(),
    model.count(q).exec()
  ]).spread(function(results, count) {
    return [
      results,
      Math.ceil(count / resultsPerPage) || 1,
      count
    ]
  });
}
1203956
function (web3Provider, result) {
    return new Promise(function (onResolve, onReject) {
      onResolve(web3Provider.utils.hexToNumber(result));
    });
  }