Skip to content

Conversation

@goldcaddy77
Copy link
Owner

No description provided.

@goldcaddy77 goldcaddy77 force-pushed the 457-custom-db-connection-2 branch from 4952275 to 5d1c8e3 Compare May 28, 2021 20:04
apolloConfig?: ApolloServerExpressConfig;
authChecker?: AuthChecker<T>;
autoGenerateFiles?: boolean;
connectionGetter?: (config: Config) => Connection | Promise<Connection>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd prefer this to either be a drop in Connection or for the input parameter to this function type be typeorm's ConnectionOptions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
connectionGetter?: (config: Config) => Connection | Promise<Connection>;
connectionGetter?: (options: ConnectionOptions) => Connection | Promise<Connection>;
Suggested change
connectionGetter?: (config: Config) => Connection | Promise<Connection>;
connection?: Connection;

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Connection - in this case, there would be no way to reconnect in the case the server drops the DB connection, right? Is that ok?
ConnectionOptions - Server already allows you to pass ConnectionOptions: https://github.com/goldcaddy77/warthog/pull/458/files#R67 . Could you just use that? I figured you needed access to the raw connection to be able to mutate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants