WithListsFixed<T>: T extends PagedList<infer IT, infer NAME>
    ? PagedList<Exclude<IT, null | undefined>, NAME>
    : T extends Record<string, unknown>
        ? {
            [K in keyof T]: WithListsFixed<T[K]>
        }
        : T

Recursively looks through a result type and removes nulls and and undefined from PagedList types.

Although a graphql response might contain empty values in an array, this will only be the case when we also have errors, which will then be thrown.

Type Parameters

  • T