#orphanedTypes combined with forRootAsync does not generate specified types
1 messages · Page 1 of 1 (latest)
But when working with gql federation, we might want to extend a type and add a field. As they are not used in a query or mutation of this subgraph, they get ignored during generation
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
Detailed Problem Description for Apollo Federation Gateway with NestJS Context I am working on a federated GraphQL setup using Apollo Federation 2 with NestJS. I have a supergraph running on a gateway and two subgraphs. I’m encountering a schema generation issue when configuring one of the subgraphs using forRootAsync while the gateway fails...
That is a different problem. So, not sure why I should be reading it for your problem.
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
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
@narrow mesa only orphanedTypes are not getting generated. Other types/resolvers (that has query and mutation) is generating well.
Hmmm…. I don‘t have an answer then. Does the orphanedTypes work for you with forRoot?
@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
🤷🏻