Skip to content

Commit

Permalink
Omit websocket functionality (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie authored Apr 24, 2019
2 parents b80865a + a5c5099 commit 64bc50f
Show file tree
Hide file tree
Showing 5 changed files with 628 additions and 567 deletions.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
"dependencies": {
"aws-serverless-express": "^3.3.5",
"cors": "^2.8.5",
"pg": "7.4.1",
"postgraphile": "v4.2",
"postgraphile-core": "^4.2.0"
"pg": "^7.9.0",
"postgraphile": "^4.4.0-beta.9"
},
"devDependencies": {
"aws-sdk": "^2.389.0",
"aws-sdk": "^2.437.0",
"serverless-content-encoding": "^1.1.0",
"webpack": "4.17.2",
"webpack-cli": "3.1.0"
"webpack": "4.29.6",
"webpack-cli": "3.3.0"
}
}
6 changes: 3 additions & 3 deletions src/makeCache.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// This script is called from scripts/generate-cache
const { createPostGraphileSchema } = require('postgraphile-core');
const { createPostGraphileSchema } = require('postgraphile');
const { options } = require('./postgraphileOptions');
const pg = require('pg');
const { Pool } = require('pg');

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

async function main() {
const pgPool = new pg.Pool({
const pgPool = new Pool({
connectionString: process.env.DATABASE_URL,
});
await createPostGraphileSchema(pgPool, schemas, {
Expand Down
1 change: 1 addition & 0 deletions src/postgraphile-http-subscriptions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export async function enhanceHttpServerWithSubscriptions() {}
6 changes: 6 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ module.exports = {
}),
new webpack.NormalModuleReplacementPlugin(/pg\/lib\/native\/index\.js$/, '../client.js'),
],

// Omit websocket functionality from postgraphile:
new webpack.NormalModuleReplacementPlugin(
/postgraphile\/build\/postgraphile\/http\/subscriptions\.js$/,
`${__dirname}/src/postgraphile-http-subscriptions.js`
),

// Just in case you install express:
new webpack.NormalModuleReplacementPlugin(
Expand Down
Loading

0 comments on commit 64bc50f

Please sign in to comment.