Is incremental adoption of TypeGraphQL possible? #1374
-
I would like to incrementally migrate my project to TypeGraphQL, but the issue I run into is when I'm defining Fields that are of a type that hasn't been declared yet as an ObjectType, I get the error:
In other words, if a type only exists in my manually declared GraphQL schema and has not yet been migrated to an TypeGraphQL ObjectType, I can't use it as a Field type. Defining ObjectTypes as I need them will basically just cascade into migrating the entire project. Is there some generic type I could add to the Field decorator to make this work? Or maybe there's a simpler solution that I haven't managed to find in other discussions and examples.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think I may be asking a very similar question to this, just in a slightly different way: #1176 |
Beta Was this translation helpful? Give feedback.
-
No, you can't refer somewhere existing type name. However you can try to migrate types first, leaving resolvers in the old way and merge the declarations. |
Beta Was this translation helpful? Give feedback.
No, you can't refer somewhere existing type name. However you can try to migrate types first, leaving resolvers in the old way and merge the declarations.
There are also tools/plugins to generate TypeGraphQL types from existing schema 😀