Skip to content

getConnection from TypeORM is deprecated -- update README to use DataSource instead #42

Open
@thatguyintech

Description

@thatguyintech

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 }),
    });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions