Open apopapazisis opened 8 months ago
Yes, it should be possible. You will just have to refer to the NestJS code to determine what metadata gets attached when those decorators are used and then you can use the Discovery package to look them up
@WonderPanda I try to do this
import { NestFactory } from '@nestjs/core';
import { Module } from '@nestjs/common';
import { DiscoveryModule, DiscoveryService } from '@golevelup/nestjs-discovery';
import { GraphQLSchemaBuilderModule } from '@nestjs/graphql';
@Module({
imports: [
DiscoveryModule,
GraphQLSchemaBuilderModule
]
})
class CustomModule {}
const main = async () => {
const app = await NestFactory.create(CustomModule);
await app.init();
const discoveryService = app.get(DiscoveryService);
const resolvers = await discoveryService.providersWithMetaAtKey('graphql:resolver');
console.log(resolvers)
};
main();
which returns an empty array, I am not sure that the code I have is 100% correct.
@apopapazisis Would it be possible to have a repro (maybe gh repo) to help with this? There's some potential tweaks such as the gql resolver symbol being invalid :sweat_smile:
is it possible to discover graphql mutations, queries, subscriptions?