Skip to content

Generic fields based on keyof class types #1465

Answered by MichalLytek
knovu asked this question in Q&A
Discussion options

You must be logged in to vote

The names of the properties of the object type fields exists in runtime but are hardly hardcoded in the metadata storage.
They are not exposed and not accessible for users.

Instead of making fancy solutions, just make an enum that matches properties of the object type and pass that as param to DynamicFilter - TS will do the rest of the checking of accessing those properties by name from enum.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@knovu
Comment options

@knovu
Comment options

Answer selected by knovu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants