Skip to content

Commit

Permalink
feat: upgrade postgraphile-core (#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie authored Sep 13, 2018
1 parent e75cbd7 commit db017b5
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 143 deletions.
52 changes: 33 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
[![Package on npm](https://img.shields.io/npm/v/postgraphile.svg?style=flat)](https://www.npmjs.com/package/postgraphile)
![MIT license](https://img.shields.io/npm/l/postgraphile.svg)
[![Gitter chat room](https://badges.gitter.im/graphile/postgraphile.svg)](https://gitter.im/graphile/postgraphile?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
<span class="badge-patreon"><a href="https://patreon.com/benjie" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
[![Donate](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.me/benjie)
<span class="badge-patreon"><a href="https://patreon.com/benjie" title="Support PostGraphile development on Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
[![Follow](https://img.shields.io/badge/[email protected])](https://twitter.com/benjie)

_An instant, highly-performant GraphQL API for your PostgreSQL database._
_An instant, highly-performant GraphQL API for your PostgreSQL database, extensible via a powerful plugin system._

**Documentation: [graphile.org/postgraphile](https://graphile.org/postgraphile)**

_Note: v1-v3 of this project were named **PostGraphQL**. A v3-v4 migration guide is
available [here](https://www.graphile.org/postgraphile/v3-migration/) and you can check
out some of the new features
[here](https://www.graphile.org/postgraphile/v4-new-features/). No more development is taking place on v3, but you can still access its branch [here](https://github.com/graphile/postgraphile/tree/v3)._
[here](https://www.graphile.org/postgraphile/v4-new-features/). No more
development is taking place on v3, but you can still access its branch
[here](https://github.com/graphile/postgraphile/tree/v3)._

---

Expand Down Expand Up @@ -64,8 +65,8 @@ postgraphile --help
You can also use PostGraphile as [native HTTP, Connect, Express, or Koa (experimental) middleware](https://www.graphile.org/postgraphile/usage-library/), e.g.:

```js
import { createServer } from "http";
import postgraphile from "postgraphile";
import { createServer } from 'http';
import postgraphile from 'postgraphile';

createServer(postgraphile());
```
Expand All @@ -87,7 +88,6 @@ E.g. you might run this command (substituting the relevant variables):
docker run -p 5000:5000 graphile/postgraphile --connection postgres://POSTGRES_USER:POSTGRES_PASSWORD@POSTGRES_HOST:POSTGRES_PORT/POSTGRES_DATABASE --schema app_public --watch
```


## Read More

**Full documentation for PostGraphile is located at [graphile.org/postgraphile](https://graphile.org/postgraphile).**
Expand Down Expand Up @@ -118,10 +118,6 @@ PostGraphile features include:
[advanced queries documentation]: https://www.graphile.org/postgraphile/custom-queries/
[row-level-security]: http://www.postgresql.org/docs/current/static/ddl-rowsecurity.html

## Commercial Support and Consultancy Services

Commercial support, consultancy and development services are available direct from the maintainer; see [Professional Services](https://www.graphile.org/support/) for more information.

## Requirements

- Node v8.6+
Expand All @@ -130,21 +126,39 @@ Commercial support, consultancy and development services are available direct fr

Caveats:

- Support for PG10-specific features is not fully implemented yet
- PostGraphile is not tested on Windows, if you notice any issues please file them (or send a PR!)
- PostGraphile does not have automated tests on Windows, if you notice any
issues please file them (or send a PR!)

## Supporting PostGraphile

The fastest and easiest way you can help PostGraphile thrive is by [sponsoring
ongoing development and maintenance](https://graphile.org/donate).

## Contributing and Maintenance
Want to help testing and developing PostGraphile? Check out the [contributing
document](CONTRIBUTING.md) to get started quickly!

Want to help testing and developing PostGraphile? Check out the [contributing document](CONTRIBUTING.md) to get started quickly!
Commercial support, consultancy and development services are available direct
from the maintainer; see [Professional Services](https://www.graphile.org/support/)
for more information, or get in touch!

The maintainer of this project is [@Benjie](https://twitter.com/benjie) - follow him on Twitter!
The maintainer of this project is [@Benjie](https://twitter.com/benjie) -
follow him on Twitter!

## Thanks

Huge thanks to [the individuals who sponsor PostGraphile's development](SPONSORS.md) - their support helps me spend more time working on the project! If you want the project to advance more rapidly, please join them in supporting this project 🙏
Huge thanks to [the individuals and companies who sponsor PostGraphile's
development](SPONSORS.md) - their financial contributions enable more time to
be spent on the project: from bug fixes, to code review, to new features! If
you want to help the project advance more rapidly, please join them in
[supporting this project](https://graphile.org/donate) 🙏

A humongous, heart-felt, thank you to the original author of PostGraphile - [Caleb Meredith](https://twitter.com/calebmer) - for everything he put into PostGraphile! He's now graduated from the project and we all wish him the best for his future ventures!
A humongous, heart-felt, thank you to the original author of PostGraphile -
[Caleb Meredith](https://twitter.com/calebmer) - for everything he put into
PostGraphile! He's now graduated from the project and we all wish him the best
for his future ventures!

Thanks also to the people working on [PostgREST](https://github.com/begriffs/postgrest) which was a huge inspiration for this project!
Thanks also to the people working on
[PostgREST](https://github.com/begriffs/postgrest) which was a huge inspiration
for this project!

Thanks and enjoy 👍
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@types/graphql": "^0.13.4",
"@types/jsonwebtoken": "<7.2.1",
"@types/koa": "2.0.44",
"@types/koa": "^2.0.44",
"@types/pg": "^7.4.10",
"body-parser": "^1.15.2",
"chalk": "^1.1.3",
Expand All @@ -55,23 +55,23 @@
"parseurl": "^1.3.1",
"pg": ">=6.1.0 <8",
"pg-connection-string": "^0.1.3",
"pg-sql2": "2.2.1",
"postgraphile-core": "4.0.0-rc.10",
"pg-sql2": "^2.2.1",
"postgraphile-core": "4.0.0-rc.11",
"send": "^0.16.1",
"tslib": "^1.5.0"
},
"devDependencies": {
"@types/chalk": "^0.4.30",
"@types/commander": ">=2.3.30 <2.12.0",
"@types/debug": "0.0.29",
"@types/finalhandler": "0.0.32",
"@types/http-errors": "1.6.1",
"@types/debug": "^0.0.29",
"@types/finalhandler": "^0.0.32",
"@types/http-errors": "^1.6.1",
"@types/jest": "^16.0.4",
"@types/lodash": "^4.14.110",
"@types/lru-cache": "4.1.1",
"@types/node": "^7.0.4",
"@types/parseurl": "1.3.1",
"@types/send": "0.14.4",
"@types/lru-cache": "^4.1.1",
"@types/node": "^10.9.4",
"@types/parseurl": "^1.3.1",
"@types/send": "^0.14.4",
"connect": "^3.5.0",
"express": "^4.14.0",
"graphiql": "^0.11.11",
Expand All @@ -80,15 +80,15 @@
"koa-compress": "^3.0.0",
"nodemon": "^1.11.0",
"pg-minify": "~0.5.3",
"prettier": "1.13.7",
"prettier": "^1.13.7",
"react": "^15.3.2",
"react-dom": "^15.3.2",
"react-scripts": "1.1.1",
"react-scripts": "^1.1.1",
"source-map-support": "^0.4.6",
"supertest": "^2.0.1",
"ts-node": "^2.0.0",
"tslint": "^5.10.0",
"tslint-config-prettier": "1.14.0",
"tslint-config-prettier": "^1.14.0",
"typescript": "^2.9.2"
},
"jest": {
Expand Down
11 changes: 7 additions & 4 deletions src/postgraphile/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ if (program['plugins']) {
}

// Kill server on exit.
process.on('SIGINT', process.exit);
process.on('SIGINT', () => {
process.exit(1);
});

// Destruct our configuration file and command line arguments, use defaults, and rename options to
// something appropriate for JavaScript.
Expand Down Expand Up @@ -552,8 +554,8 @@ if (noServer) {
} else {
function killAllWorkers(signal = 'SIGTERM'): void {
for (const id in cluster.workers) {
if (cluster.workers.hasOwnProperty(id)) {
cluster.workers[id].kill(signal);
if (cluster.workers.hasOwnProperty(id) && !!cluster.workers[id]) {
cluster.workers[id]!.kill(signal);
}
}
}
Expand Down Expand Up @@ -630,7 +632,8 @@ if (noServer) {
// Start our server by listening to a specific port and host name. Also log
// some instructions and other interesting information.
server.listen(port, hostname, () => {
const actualPort = server.address().port;
const address = server.address();
const actualPort = typeof address === 'string' ? port : address.port;
const self = cluster.isMaster
? 'server'
: `worker ${process.env.POSTGRAPHILE_WORKER_NUMBER} (pid=${process.pid})`;
Expand Down
Loading

0 comments on commit db017b5

Please sign in to comment.