Postgraphile: Have poolOrConfig throw if invalid

Created on 15 Aug 2017  路  2Comments  路  Source: graphile/postgraphile

In the final fallback poolOrConfig || {}:

https://github.com/postgraphql/postgraphql/blob/233f55c53f8c982cb566b48b63e0fa5bcc7ed1fd/src/postgraphql/postgraphql.ts#L83-L92

we should check that poolOrConfig is a simple object (and not, for example, a pool returned from a different version of the pg module 馃槨 ) and throw with a helpful error if not.

馃搫 add-to-docs 馃槍 Fixed in v4 馃槍 easy 馃ぉ good-first-bug

Most helpful comment

Just stumbled upon this myself, a documentation page has pg-pool as an example, which isn't an instance of Pool from pg module, which causes errors. That documentation page should be fixed as well.

All 2 comments

Just stumbled upon this myself, a documentation page has pg-pool as an example, which isn't an instance of Pool from pg module, which causes errors. That documentation page should be fixed as well.

We have quacksLikePgPool now; so due to this duck-typing this shouldn't be an issue any more.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WestleyArgentum picture WestleyArgentum  路  3Comments

jayp picture jayp  路  3Comments

angelosarto picture angelosarto  路  3Comments

tazsingh picture tazsingh  路  3Comments

mrbarletta picture mrbarletta  路  5Comments