gql_extract_arg(agooErr err, gqlField field, gqlSel sel, const char *key) {
    if (NULL != sel->args) {
	gqlSelArg	sa;
	gqlValue	v = NULL;

	for (sa = sel->args; NULL != sa; sa = sa->next) {
	    if (0 != strcmp(sa->name, key)) {
		continue;
	    }
	    if (NULL != sa->var) {
		v = sa->var->value;
	    } else {
		v = sa->value;
	    }
	    if (NULL != field) {
		gqlArg	fa;

		for (fa = field->args; NULL != fa; fa = fa->next) {
		    if (0 == strcmp(sa->name, fa->name)) {
			if (v->type != fa->type && GQL_SCALAR_VAR != v->type->scalar_kind) {
			    if (AGOO_ERR_OK != gql_value_convert(err, v, fa->type)) {
				return NULL;
			    }
			}
			break;
		    }
		}
	    }
	}
	return v;
    }
    return NULL;
}
gql_extract_arg(agooErr err, gqlField field, gqlSel sel, const char *key) {
    if (NULL != sel->args) {
	gqlSelArg	sa;
	gqlValue	v = NULL;

	for (sa = sel->args; NULL != sa; sa = sa->next) {
	    if (0 != strcmp(sa->name, key)) {
		continue;
	    }
	    if (NULL != sa->var) {
		v = sa->var->value;
	    } else {
		v = sa->value;
	    }
	    if (NULL != field) {
		gqlArg	fa;

		for (fa = field->args; NULL != fa; fa = fa->next) {
		    if (0 == strcmp(sa->name, fa->name)) {
			if (v->type != fa->type && GQL_SCALAR_VAR != v->type->scalar_kind) {
			    if (AGOO_ERR_OK != gql_value_convert(err, v, fa->type)) {
				return NULL;
			    }
			}
			break;
		    }
		}
	    }
	}
	return v;
    }
    return NULL;
}