I found this resource, which works great for types that don't have nested props. https://bobbyhadz.com/blog/typescript-remove-null-and-undefined-from-type
But in my case, I need to strip all props, even nested ones.
Is there any solution for doing that?
Note. My types are automatically generated in hundreds, so manually doing it is not an option.
Example type:
type BlogSlugQuery = {
__typename?: "Query" | undefined;
Blogs?: {
__typename?: "Blogs" | undefined;
docs?: ({
__typename?: "Blog" | undefined;
slug?: string | null | undefined;
} | null)[] | null | undefined;
} | null | undefined;
}
