Trouble merging type-graphql schema with existing schema #1384
-
Based on a previous discussion about migrating to TypeGraphQL incrementally in a large project, I'm trying to migrate only types first while leaving resolvers as they were. I've tried a number of different ways, but the end result is 'Unknown type' errors for all types referenced in the resolvers schema definition. Here's a simplified version of a couple of my attempts: Notification.ts
typeDefs.ts
index.ts
Attempt 2 (using graphql-tools)
I've tried a number of other combinations of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You need to manually add the object types classes to schema via the |
Beta Was this translation helpful? Give feedback.
You need to manually add the object types classes to schema via the
orphanedTypes
property.TypeGraphQL traverse imports chain and include all the types defined in TypeGraphQL's
@Resolver
's, but since you do not define them, you can't rely on that mechanism 😉