src/resolvers.js
function execute_conditional(
	nextql,
	value,
	valueModel,
	conditional,
	query,
	info,
	context
) {
	let model;

	const modelName = valueModel.check(
		value,
		conditional,
		query.$params,
		context,
		info
	);

	if (modelName instanceof Error) {
		return Promise.reject(modelName);
	}

	if (modelName === true) {
		model = valueModel;
	}

	if (typeof modelName == "string" && modelName != "*") {
		model = nextql.model(modelName);
	}

	if (!model) return Promise.resolve();

	return resolve_object_value(nextql, value, model, query, info, context);
}
function execute_conditional(
	nextql,
	value,
	valueModel,
	conditional,
	query,
	info,
	context
) {
	let model;

	const modelName = valueModel.check(
		value,
		conditional,
		query.$params,
		context,
		info
	);

	if (modelName instanceof Error) {
		return Promise.reject(modelName);
	}

	if (modelName === true) {
		model = valueModel;
	}

	if (typeof modelName == "string" && modelName != "*") {
		model = nextql.model(modelName);
	}

	if (!model) return Promise.resolve();

	return resolve_object_value(nextql, value, model, query, info, context);
}
function execute_conditional ( nextql , value , valueModel , conditional , query , info , context ) { let model ; const modelName = valueModel . check ( value , conditional , query . $params , context , info ) ; if ( modelName instanceof Error ) { return Promise . reject ( modelName ) ; } if ( modelName === true ) { model = valueModel ; } if ( typeof modelName == "string" && modelName != "*" ) { model = nextql . model ( modelName ) ; } if ( ! model ) return Promise . resolve ( ) ; return resolve_object_value ( nextql , value , model , query , info , context ) ; }
Given value, valueModel and conditional path; call conditional function and process result
@param {*} nextql
@param {*} value
@param {*} valueModel
@param {*} conditionalQuery
@param {*} info
@param {*} context
Given value valueModel and conditional path ; call conditional function and process result