Narrows a lookup response type to the fields named by a fields selection
expression, including nested (dotted) paths.
SelectedFields<IpInfo, 'location.region'> is
{ location: { region: Region } }, so accessing an unselected field such
as location.city is a compile-time error. Comma-separated selections are
merged: 'location.region,location.city' yields
{ location: { region: Region; city: string | null } }. Paths that
traverse arrays narrow the element type. Unknown path segments contribute
nothing to the result. When the expression is not a literal type (a plain
string), the full response type is kept.
Narrows a lookup response type to the fields named by a
fieldsselection expression, including nested (dotted) paths.SelectedFields<IpInfo, 'location.region'>is{ location: { region: Region } }, so accessing an unselected field such aslocation.cityis a compile-time error. Comma-separated selections are merged:'location.region,location.city'yields{ location: { region: Region; city: string | null } }. Paths that traverse arrays narrow the element type. Unknown path segments contribute nothing to the result. When the expression is not a literal type (a plainstring), the full response type is kept.