#Graphql complexity plugin with fédération

2 messages · Page 1 of 1 (latest)

scenic prairie
#

Hello, i have been folowing the documentation here: https://docs.nestjs.com/graphql/complexity

And than import the plugin in the providers of the app.module but i can see that the schema object from this.gqlSchemaHost; is undefined.

This lead to error : Unexpected error processing request: Error: GraphQL schema has not yet been created. Make sure to call the "GraphQLSchemaHost#schema" getter when the application is already initialized (after the "onModuleInit" hook triggered by either "app.listen()" or "app.init()" method).

I think this is because i am using federation and the schema is not created in the first place but i can't figure out how to make it work.
I am also using GraphQLModule.forRootAsync and useFactory to init my GraphqlModule maybe it is related.
Thanks in advance for helping me.

#

While writing this i was slowly supposing that this plugin is not meant to work with the gateway but only subgraphs