Type Alias SelectFrom<Full, Selection, Depth>

SelectFrom<Full, Selection, Depth>: Depth extends TsTooMuchRecursion
    ? ["Error: recursive object depth is too deep."]
    : Full extends ReadonlyArray<infer Element extends any>
        ? (SelectFrom<Extract<Element, AnyObject>, Selection, TsRecurse<Depth>> | Exclude<Element, AnyObject>)[]
        : {
            -readonly [Key in keyof Selection as Selection[Key] extends false
                ? never
                : Key extends keyof Full
                    ? Key
                    : never]: (Selection[Key] extends GenericSelectionSet
                ? SelectFrom<NonNullable<Extract<Full[Key], AnyObject>>, Selection[Key], TsRecurse<Depth>>
                : Full[Key]) | Exclude<Full[Key], AnyObject>
        }

Performs a SQL-like nested selection on an object, extracting the selected values. This produces the output type for selectFrom.

Type Parameters