field_type(agooErr err, gqlDoc doc, gqlCobj obj, gqlField field, gqlSel sel, gqlValue result, int depth) {
    gqlField		f = (gqlField)obj->ptr;
    const char		*key = sel->name;
    struct _gqlCobj	child = { .clas = &type_class };
    gqlValue		co;

    if (NULL != sel->alias) {
	key = sel->alias;
    }
    if (NULL == f || NULL == f->type) {
	co = gql_null_create(err);

	return gql_object_set(err, result, key, co);
    }
    if (NULL == (co = gql_object_create(err)) ||
	AGOO_ERR_OK != gql_object_set(err, result, key, co)) {
	return err->code;
    }
    child.ptr = (void*)f->type;

    return gql_eval_sels(err, doc, (gqlRef)&child, field, sel->sels, co, depth + 1);
}
field_type(agooErr err, gqlDoc doc, gqlCobj obj, gqlField field, gqlSel sel, gqlValue result, int depth) {
    gqlField		f = (gqlField)obj->ptr;
    const char		*key = sel->name;
    struct _gqlCobj	child = { .clas = &type_class };
    gqlValue		co;

    if (NULL != sel->alias) {
	key = sel->alias;
    }
    if (NULL == f || NULL == f->type) {
	co = gql_null_create(err);

	return gql_object_set(err, result, key, co);
    }
    if (NULL == (co = gql_object_create(err)) ||
	AGOO_ERR_OK != gql_object_set(err, result, key, co)) {
	return err->code;
    }
    child.ptr = (void*)f->type;

    return gql_eval_sels(err, doc, (gqlRef)&child, field, sel->sels, co, depth + 1);
}