You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to export a union of all generated Entries/Content Types?
Use cases:
When I call ContentfulClientApi.getEntries<T> I know I should be passing one of these types in as the generic, so it would be useful for me to apply this guard before the getEntries call to ensure a valid generic type has been passed.
If I have a renderer function intended to handle all entry types, I could also utilise this generated union to ensure I have handled all possible entry types, potentially using union type subtraction for cases I know I'm not handling.
Once the property type guard is available, I can use entry.sys.contentType.sys.id to infer the type of entry.sys
The text was updated successfully, but these errors were encountered:
penx
changed the title
Feature Request: Union of all entries
Feature Request: Export union of all entries
Dec 9, 2021
Would it be possible to export a union of all generated Entries/Content Types?
Use cases:
ContentfulClientApi.getEntries<T>
I know I should be passing one of these types in as the generic, so it would be useful for me to apply this guard before the getEntries call to ensure a valid generic type has been passed.entry.sys.contentType.sys.id
to infer the type ofentry.sys
The text was updated successfully, but these errors were encountered: