Skip to content

Commit 64bc50f

Browse files
authored
Omit websocket functionality (#9)
2 parents b80865a + a5c5099 commit 64bc50f

File tree

5 files changed

+628
-567
lines changed

5 files changed

+628
-567
lines changed

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@
1313
"dependencies": {
1414
"aws-serverless-express": "^3.3.5",
1515
"cors": "^2.8.5",
16-
"pg": "7.4.1",
17-
"postgraphile": "v4.2",
18-
"postgraphile-core": "^4.2.0"
16+
"pg": "^7.9.0",
17+
"postgraphile": "^4.4.0-beta.9"
1918
},
2019
"devDependencies": {
21-
"aws-sdk": "^2.389.0",
20+
"aws-sdk": "^2.437.0",
2221
"serverless-content-encoding": "^1.1.0",
23-
"webpack": "4.17.2",
24-
"webpack-cli": "3.1.0"
22+
"webpack": "4.29.6",
23+
"webpack-cli": "3.3.0"
2524
}
2625
}

src/makeCache.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// This script is called from scripts/generate-cache
2-
const { createPostGraphileSchema } = require('postgraphile-core');
2+
const { createPostGraphileSchema } = require('postgraphile');
33
const { options } = require('./postgraphileOptions');
4-
const pg = require('pg');
4+
const { Pool } = require('pg');
55

66
const schemas = process.env.DATABASE_SCHEMAS
77
? process.env.DATABASE_SCHEMAS.split(',')
88
: ['app_public'];
99

1010
async function main() {
11-
const pgPool = new pg.Pool({
11+
const pgPool = new Pool({
1212
connectionString: process.env.DATABASE_URL,
1313
});
1414
await createPostGraphileSchema(pgPool, schemas, {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export async function enhanceHttpServerWithSubscriptions() {}

webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ module.exports = {
2727
}),
2828
new webpack.NormalModuleReplacementPlugin(/pg\/lib\/native\/index\.js$/, '../client.js'),
2929
],
30+
31+
// Omit websocket functionality from postgraphile:
32+
new webpack.NormalModuleReplacementPlugin(
33+
/postgraphile\/build\/postgraphile\/http\/subscriptions\.js$/,
34+
`${__dirname}/src/postgraphile-http-subscriptions.js`
35+
),
3036

3137
// Just in case you install express:
3238
new webpack.NormalModuleReplacementPlugin(

0 commit comments

Comments
 (0)