#orphanedTypes combined with forRootAsync does not generate specified types

1 messages · Page 1 of 1 (latest)

narrow mesa
#

Because all GraphQL types form a graph and there are no nodes in a graph that can be orphaned.

#

@night hearth

night hearth
#

If you could take a look at this post, that would be great too. Thank you !
https://community.apollographql.com/t/detailed-problem-description-for-apollo-federation-gateway-with-nestjs/8022

narrow mesa
night hearth
#

How is it not the same ? It explains that if working with synchronous way (GraphQLModule.forRoot), specified orphaned types get to be generated, but working with forAsyncRoot is not doing it.

#

@narrow mesa

narrow mesa
#

So, the problem isn't the orphanedTypes, but rather forRootAsync not working. Or, does it work, when you remove the orphanedTypes property? Neither you or the author of that other post point out that the orphanedTypes is the cause of forRootAsync not working.

#

@night hearth

night hearth
#

@narrow mesa only orphanedTypes are not getting generated. Other types/resolvers (that has query and mutation) is generating well.

narrow mesa
#

Hmmm…. I don‘t have an answer then. Does the orphanedTypes work for you with forRoot?

night hearth
#

@narrow mesa sorry for delay, tested it just now. turns out it is not working with forRoot either

#

but once i add a query to the resolver of the orphanedType, it get generated well

#

My code looks like this

⌙ app.module.ts
⌙ src/domains
⌙ orphanedType
⌙ orphanedType.dto.ts
⌙ orphanedType.resolver.ts
⌙ orphanedType.module.ts
⌙ domains.module.ts

OrphanedTypeModule has its provider defined with orphanedTypeResolver
DomainsModule imports OrphanedTypeModule
AppModule imports DomainsModule and GraphQLModule.
I pass orphanedTypeDTO to GraphQLModule setup

narrow mesa
#

🤷🏻