Checks that an image value has an asset that a URL can be built from. Image fields can be saved before an asset is uploaded, and an asset-> projection returns null when the asset is missing, so TypeGen types asset as optional or nullable.
asset->
null
asset
if (isImageWithAsset(data?.cover)) { builder.image(data.cover).width(800).url()} Copy
if (isImageWithAsset(data?.cover)) { builder.image(data.cover).width(800).url()}
Checks that an image value has an asset that a URL can be built from. Image fields can be saved before an asset is uploaded, and an
asset->projection returnsnullwhen the asset is missing, so TypeGen typesassetas optional or nullable.