type-graphql-dataloader icon indicating copy to clipboard operation
type-graphql-dataloader copied to clipboard

Is Apollo required?

Open codechrysalis-doug opened this issue 3 years ago • 1 comments

I am getting this error typeormGetConnection is undefined, and I am unsure why. The docs indicate that Apollo isn't required, but I am unsure if this is the because of this error.

If your application uses Apollo Server, pass ApolloServerLoaderPlugin() as a plugin when instantiating the server.

codechrysalis-doug avatar Feb 20 '22 11:02 codechrysalis-doug

It is required to do what is done in ApolloServerLoaderPlugin() against each request's pre-call and post-call. Therefore, if apollo-server is used, just passing ApolloServerLoaderPlugin() as a plugin would suffice. Otherwise, calling ApolloServerLoaderPlugin.requestDidStart and ApolloServerLoaderPlugin.willSendResponse against each request might work.

slaypni avatar Feb 20 '22 17:02 slaypni