how to handle dynamic properties #879
Unanswered
balazssoltesz
asked this question in
Q&A
Replies: 1 comment 3 replies
-
You should describe the languages as an enum and then create an object type with So then you can in runtime return proper data, like: return {
data: "...",
intl: {
lang: Language.EN,
value: "foo bar",
},
}; |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I try to figure out, how should i handle dynamic properties in an Object/InputType. My main problem is i declared languages in my app's config file, and want to generate ObjectType and InputType based on my used languages in the app.
So i have an array with available languages:
const languages = ["en", "de"] as const;
An I wanna generate types based on this array:
But it doesn't work. Any idea, how can i handle this issue?
Beta Was this translation helpful? Give feedback.
All reactions