Description
When using graphql-postgres-subscriptions-retry with pg@8+, the following warning appears:
DeprecationWarning: Calling client.query() when the client is already executing a query is deprecated and will be removed in pg@9.0.
It happens during topic initialization in initTopics:
initTopics(triggers) {
return Promise.all(triggers.map((eventName) => {
return this.pgListen.listenTo(eventName);
}));
}
Each listenTo() uses the same pg.Client, so running them in parallel triggers the warning.
Proposed Fix
Serialize the calls instead:
async initTopics(triggers) {
for (const eventName of triggers) {
await this.pgListen.listenTo(eventName);
}
}
It would be great if someone could apply this small fix so the library is fully compatible with pg@8+ and ready for pg@9.
Description
When using
graphql-postgres-subscriptions-retrywithpg@8+, the following warning appears:It happens during topic initialization in initTopics:
Each
listenTo()uses the samepg.Client, so running them in parallel triggers the warning.Proposed Fix
Serialize the calls instead:
It would be great if someone could apply this small fix so the library is fully compatible with
pg@8+and ready forpg@9.