API at runtime #3086
Replies: 2 comments 4 replies
-
I'm not really sure what you're asking here. TypeScript "Generics" are a compile-time thing, not runtime behavior. It's certainly possible to generate endpoint descriptions via code and call That said, "just automagically work somehow" really isn't a clear description of what you're really trying to do :) |
Beta Was this translation helpful? Give feedback.
-
Fair enough. And that vagueness is a side-effect of my ignorance. I'm just trying to figure out how its possible to set up RTK Query without knowing the data models ahead of time. So I wouldn't know the type Pokemon at compile time. If I injectEndpoints after that is it possible to have the state syncing functionality without knowing any of the types ahead of time? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to create an API dynamically at runtime from the GraphQL schema? Not using code generation but rather perhaps through generics? We're creating a CMS that allows users to create their own content types through no code. It would be nice if they could then access those models via graphql without having to generate code files. It would just automagically work somehow.
This would be using Typescript. Any pointers would be helpful.
Beta Was this translation helpful? Give feedback.
All reactions