type-graphql-dataloader
type-graphql-dataloader copied to clipboard
getConnection from TypeORM is deprecated -- update README to use DataSource instead
getConnection
is now deprecated in Typeorm
So the README getting started instructions should do something like this instead:
export const initializeDataSource = async () => {
const options = {...};
return new DataSource(options);
}
const initializeApolloServer = async() => {
const dataSource = await initializeDataSource();
if (dataSource.isInitialized === false) {
logger.debug("Initializing data source...");
await dataSource.initialize();
}
return new ApolloServer({
schema,
plugins: [ ApolloServerLoaderPlugin({ typeormGetConnection: dataSource }),
});
}