postgraphile 4.12.12 → 5.0.0-0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/LICENSE.md +15 -20
- package/README.md +17 -172
- package/dist/cli-run.d.ts +3 -0
- package/dist/cli-run.d.ts.map +1 -0
- package/dist/cli-run.js +7 -0
- package/dist/cli-run.js.map +1 -0
- package/dist/cli.d.ts +21 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +180 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +88 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/PgV4BehaviorPlugin.d.ts +11 -0
- package/dist/plugins/PgV4BehaviorPlugin.d.ts.map +1 -0
- package/dist/plugins/PgV4BehaviorPlugin.js +73 -0
- package/dist/plugins/PgV4BehaviorPlugin.js.map +1 -0
- package/dist/plugins/PgV4InflectionPlugin.d.ts +11 -0
- package/dist/plugins/PgV4InflectionPlugin.d.ts.map +1 -0
- package/dist/plugins/PgV4InflectionPlugin.js +91 -0
- package/dist/plugins/PgV4InflectionPlugin.js.map +1 -0
- package/dist/plugins/PgV4NoIgnoreIndexes.d.ts +2 -0
- package/dist/plugins/PgV4NoIgnoreIndexes.d.ts.map +1 -0
- package/dist/plugins/PgV4NoIgnoreIndexes.js +72 -0
- package/dist/plugins/PgV4NoIgnoreIndexes.js.map +1 -0
- package/dist/plugins/PgV4SmartTagsPlugin.d.ts +11 -0
- package/dist/plugins/PgV4SmartTagsPlugin.d.ts.map +1 -0
- package/dist/plugins/PgV4SmartTagsPlugin.js +190 -0
- package/dist/plugins/PgV4SmartTagsPlugin.js.map +1 -0
- package/dist/presets/amber.d.ts +5 -0
- package/dist/presets/amber.d.ts.map +1 -0
- package/dist/presets/amber.js +38 -0
- package/dist/presets/amber.js.map +1 -0
- package/dist/presets/v4.d.ts +34 -0
- package/dist/presets/v4.d.ts.map +1 -0
- package/dist/presets/v4.js +142 -0
- package/dist/presets/v4.js.map +1 -0
- package/dist/schema.d.ts +34 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +82 -0
- package/dist/schema.js.map +1 -0
- package/package.json +77 -154
- package/build/assets/favicon.ico.d.ts +0 -3
- package/build/assets/favicon.ico.js +0 -6
- package/build/assets/graphiql.html.d.ts +0 -2
- package/build/assets/graphiql.html.js +0 -6
- package/build/index.d.ts +0 -8
- package/build/index.js +0 -34
- package/build/interfaces.d.ts +0 -162
- package/build/interfaces.js +0 -3
- package/build/plugins.d.ts +0 -3
- package/build/plugins.js +0 -53
- package/build/postgraphile/cli.d.ts +0 -3
- package/build/postgraphile/cli.js +0 -541
- package/build/postgraphile/extendedFormatError.d.ts +0 -9
- package/build/postgraphile/extendedFormatError.js +0 -51
- package/build/postgraphile/http/createPostGraphileHttpRequestHandler.d.ts +0 -11
- package/build/postgraphile/http/createPostGraphileHttpRequestHandler.js +0 -974
- package/build/postgraphile/http/frameworks.d.ts +0 -110
- package/build/postgraphile/http/frameworks.js +0 -258
- package/build/postgraphile/http/liveSubscribe.d.ts +0 -22
- package/build/postgraphile/http/liveSubscribe.js +0 -89
- package/build/postgraphile/http/mapAsyncIterator.d.ts +0 -15
- package/build/postgraphile/http/mapAsyncIterator.js +0 -71
- package/build/postgraphile/http/setupServerSentEvents.d.ts +0 -9
- package/build/postgraphile/http/setupServerSentEvents.js +0 -51
- package/build/postgraphile/http/subscriptions.d.ts +0 -7
- package/build/postgraphile/http/subscriptions.js +0 -410
- package/build/postgraphile/index.d.ts +0 -5
- package/build/postgraphile/index.js +0 -14
- package/build/postgraphile/pluginHook.d.ts +0 -104
- package/build/postgraphile/pluginHook.js +0 -100
- package/build/postgraphile/postgraphile.d.ts +0 -20
- package/build/postgraphile/postgraphile.js +0 -332
- package/build/postgraphile/postgraphilerc.d.ts +0 -2
- package/build/postgraphile/postgraphilerc.js +0 -16
- package/build/postgraphile/schema/exportPostGraphileSchema.d.ts +0 -6
- package/build/postgraphile/schema/exportPostGraphileSchema.js +0 -45
- package/build/postgraphile/shutdownActions.d.ts +0 -41
- package/build/postgraphile/shutdownActions.js +0 -87
- package/build/postgraphile/withPostGraphileContext.d.ts +0 -55
- package/build/postgraphile/withPostGraphileContext.js +0 -457
- package/build/postgres/inventory/pgClientFromContext.d.ts +0 -8
- package/build/postgres/inventory/pgClientFromContext.js +0 -21
- package/build-turbo/assets/favicon.ico.d.ts +0 -3
- package/build-turbo/assets/favicon.ico.js +0 -6
- package/build-turbo/assets/graphiql.html.d.ts +0 -2
- package/build-turbo/assets/graphiql.html.js +0 -6
- package/build-turbo/index.d.ts +0 -8
- package/build-turbo/index.js +0 -34
- package/build-turbo/interfaces.d.ts +0 -162
- package/build-turbo/interfaces.js +0 -3
- package/build-turbo/plugins.d.ts +0 -3
- package/build-turbo/plugins.js +0 -53
- package/build-turbo/postgraphile/cli.d.ts +0 -3
- package/build-turbo/postgraphile/cli.js +0 -572
- package/build-turbo/postgraphile/extendedFormatError.d.ts +0 -9
- package/build-turbo/postgraphile/extendedFormatError.js +0 -61
- package/build-turbo/postgraphile/http/createPostGraphileHttpRequestHandler.d.ts +0 -11
- package/build-turbo/postgraphile/http/createPostGraphileHttpRequestHandler.js +0 -982
- package/build-turbo/postgraphile/http/frameworks.d.ts +0 -110
- package/build-turbo/postgraphile/http/frameworks.js +0 -258
- package/build-turbo/postgraphile/http/liveSubscribe.d.ts +0 -22
- package/build-turbo/postgraphile/http/liveSubscribe.js +0 -89
- package/build-turbo/postgraphile/http/mapAsyncIterator.d.ts +0 -15
- package/build-turbo/postgraphile/http/mapAsyncIterator.js +0 -71
- package/build-turbo/postgraphile/http/setupServerSentEvents.d.ts +0 -9
- package/build-turbo/postgraphile/http/setupServerSentEvents.js +0 -51
- package/build-turbo/postgraphile/http/subscriptions.d.ts +0 -7
- package/build-turbo/postgraphile/http/subscriptions.js +0 -409
- package/build-turbo/postgraphile/index.d.ts +0 -5
- package/build-turbo/postgraphile/index.js +0 -14
- package/build-turbo/postgraphile/pluginHook.d.ts +0 -104
- package/build-turbo/postgraphile/pluginHook.js +0 -100
- package/build-turbo/postgraphile/postgraphile.d.ts +0 -20
- package/build-turbo/postgraphile/postgraphile.js +0 -337
- package/build-turbo/postgraphile/postgraphilerc.d.ts +0 -2
- package/build-turbo/postgraphile/postgraphilerc.js +0 -16
- package/build-turbo/postgraphile/schema/exportPostGraphileSchema.d.ts +0 -6
- package/build-turbo/postgraphile/schema/exportPostGraphileSchema.js +0 -45
- package/build-turbo/postgraphile/shutdownActions.d.ts +0 -41
- package/build-turbo/postgraphile/shutdownActions.js +0 -87
- package/build-turbo/postgraphile/withPostGraphileContext.d.ts +0 -55
- package/build-turbo/postgraphile/withPostGraphileContext.js +0 -466
- package/build-turbo/postgres/inventory/pgClientFromContext.d.ts +0 -8
- package/build-turbo/postgres/inventory/pgClientFromContext.js +0 -21
- package/cli.js +0 -6
- package/index.js +0 -5
- package/isTurbo.js +0 -11
- package/plugins.d.ts +0 -1
- package/plugins.js +0 -5
- package/sponsors.json +0 -149
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# postgraphile
|
|
2
|
+
|
|
3
|
+
## 5.0.0-0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`6576bd37b`](undefined), [`25037fc15`](undefined)]:
|
|
8
|
+
- ruru@2.0.0-0.1
|
|
9
|
+
- @dataplan/pg@0.0.1-0.2
|
|
10
|
+
- grafast@0.0.1-0.2
|
|
11
|
+
- grafserv@0.0.1-0.2
|
|
12
|
+
- graphile-build-pg@5.0.0-0.3
|
|
13
|
+
- graphile-build@5.0.0-0.3
|
|
14
|
+
- graphile-export@0.0.2-0.2
|
|
15
|
+
|
|
16
|
+
## 5.0.0-0.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [[`55f15cf35`](undefined)]:
|
|
21
|
+
- @dataplan/pg@0.0.1-0.1
|
|
22
|
+
- grafast@0.0.1-0.1
|
|
23
|
+
- graphile-build-pg@5.0.0-0.2
|
|
24
|
+
- grafserv@0.0.1-0.1
|
|
25
|
+
- graphile-build@5.0.0-0.2
|
|
26
|
+
- graphile-export@0.0.2-0.1
|
|
27
|
+
|
|
28
|
+
## 5.0.0-0.1
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- [#125](https://github.com/benjie/postgraphile-private/pull/125)
|
|
33
|
+
[`91f2256b3`](https://github.com/benjie/postgraphile-private/commit/91f2256b3fd699bec19fc86f1ca79df057e58639)
|
|
34
|
+
Thanks [@benjie](https://github.com/benjie)! - Initial changesets release
|
|
35
|
+
|
|
36
|
+
- Updated dependencies
|
|
37
|
+
[[`91f2256b3`](https://github.com/benjie/postgraphile-private/commit/91f2256b3fd699bec19fc86f1ca79df057e58639)]:
|
|
38
|
+
- ruru@2.0.0-0.0
|
|
39
|
+
- @dataplan/pg@0.0.1-0.0
|
|
40
|
+
- @graphile/lru@5.0.0-0.1
|
|
41
|
+
- grafast@0.0.1-0.0
|
|
42
|
+
- grafserv@0.0.1-0.0
|
|
43
|
+
- graphile-build@5.0.0-0.1
|
|
44
|
+
- graphile-build-pg@5.0.0-0.1
|
|
45
|
+
- graphile-config@0.0.1-0.0
|
|
46
|
+
- graphile-export@0.0.2-0.0
|
package/LICENSE.md
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
1
|
# The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright
|
|
4
|
-
Copyright (c) 2018 Benjie Gillam
|
|
3
|
+
Copyright © `2023` Benjie Gillam
|
|
5
4
|
|
|
6
|
-
Permission is hereby granted, free of charge, to any person
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Software is furnished to do so, subject to the following
|
|
13
|
-
conditions:
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the “Software”), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
14
11
|
|
|
15
|
-
The above copyright notice and this permission notice shall be
|
|
16
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
17
14
|
|
|
18
|
-
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
25
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
|
15
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
<img width="120" height="120" title="PostGraphile logo" src="https://cdn.rawgit.com/graphile/graphile.github.io/a6225f8c3052df5c276ecef28aeb0cade1aec16a/logos/postgraphile.optimized.svg" />
|
|
2
|
-
|
|
3
1
|
# PostGraphile
|
|
4
2
|
|
|
5
|
-
[](https://github.com/sponsors/benjie)
|
|
6
4
|
[](https://patreon.com/benjie)
|
|
7
5
|
[](http://discord.gg/graphile)
|
|
8
|
-
[](https://www.npmjs.com/package/postgraphile)
|
|
9
|
-

|
|
10
6
|
[](https://twitter.com/GraphileHQ)
|
|
11
7
|
|
|
12
|
-
_**Instant lightning-fast GraphQL API backed primarily by your PostgreSQL
|
|
8
|
+
_**Instant lightning-fast GraphQL API backed primarily by your PostgreSQL
|
|
9
|
+
database. Highly customisable and extensible thanks to incredibly powerful
|
|
10
|
+
plugin system.**_
|
|
11
|
+
|
|
12
|
+
**Documentation**: https://postgraphile.org/postgraphile/next/
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
An incredibly low-effort way to build a well structured and high-performance
|
|
15
|
+
GraphQL API backed primarily by a PostgreSQL database. Our main focusses are
|
|
16
|
+
performance, automatic best-practices and customisability/extensibility. Use
|
|
17
|
+
this if you have a PostgreSQL database and you want to use it as the primary
|
|
18
|
+
"source of truth" for an auto-generated GraphQL API (which you can still make
|
|
19
|
+
significant changes to).
|
|
15
20
|
|
|
16
21
|
<!-- SPONSORS_BEGIN -->
|
|
17
22
|
|
|
18
23
|
## Crowd-funded open-source software
|
|
19
24
|
|
|
20
|
-
To help us develop this software sustainably under the MIT license, we ask
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
To help us develop this software sustainably under the MIT license, we ask all
|
|
26
|
+
individuals and businesses that use it to help support its ongoing maintenance
|
|
27
|
+
and development via sponsorship.
|
|
23
28
|
|
|
24
29
|
### [Click here to find out more about sponsors and sponsorship.](https://www.graphile.org/sponsor/)
|
|
25
30
|
|
|
@@ -28,10 +33,10 @@ And please give some love to our featured sponsors 🤩:
|
|
|
28
33
|
<table><tr>
|
|
29
34
|
<td align="center"><a href="https://surge.io/"><img src="https://graphile.org/images/sponsors/surge.png" width="90" height="90" alt="Surge" /><br />Surge</a> *</td>
|
|
30
35
|
<td align="center"><a href="https://www.netflix.com/"><img src="https://graphile.org/images/sponsors/Netflix.png" width="90" height="90" alt="Netflix" /><br />Netflix</a> *</td>
|
|
36
|
+
<td align="center"><a href="https://qwick.com/"><img src="https://graphile.org/images/sponsors/qwick.png" width="90" height="90" alt="Qwick" /><br />Qwick</a> *</td>
|
|
31
37
|
<td align="center"><a href="https://www.the-guild.dev/"><img src="https://graphile.org/images/sponsors/theguild.png" width="90" height="90" alt="The Guild" /><br />The Guild</a> *</td>
|
|
32
|
-
<td align="center"><a href="http://chads.website"><img src="https://graphile.org/images/sponsors/chadf.png" width="90" height="90" alt="Chad Furman" /><br />Chad Furman</a> *</td>
|
|
33
38
|
</tr><tr>
|
|
34
|
-
<td align="center"><a href="
|
|
39
|
+
<td align="center"><a href="http://chads.website"><img src="https://graphile.org/images/sponsors/chadf.png" width="90" height="90" alt="Chad Furman" /><br />Chad Furman</a> *</td>
|
|
35
40
|
<td align="center"><a href="https://www.fanatics.com/"><img src="https://graphile.org/images/sponsors/fanatics.png" width="90" height="90" alt="Fanatics" /><br />Fanatics</a> *</td>
|
|
36
41
|
<td align="center"><a href="https://dovetailapp.com/"><img src="https://graphile.org/images/sponsors/dovetail.png" width="90" height="90" alt="Dovetail" /><br />Dovetail</a> *</td>
|
|
37
42
|
<td align="center"><a href="https://www.enzuzo.com/"><img src="https://graphile.org/images/sponsors/enzuzo.png" width="90" height="90" alt="Enzuzo" /><br />Enzuzo</a> *</td>
|
|
@@ -44,163 +49,3 @@ And please give some love to our featured sponsors 🤩:
|
|
|
44
49
|
<em>\* Sponsors the entire Graphile suite</em>
|
|
45
50
|
|
|
46
51
|
<!-- SPONSORS_END -->
|
|
47
|
-
|
|
48
|
-
## About
|
|
49
|
-
|
|
50
|
-
**GraphQL** is a new way of communicating with your server. It eliminates the problems of over- and under-fetching, incorporates strong data types, has built-in introspection, documentation and deprecation capabilities, and is implemented in many programming languages. This all leads to gloriously low-latency user experiences, better developer experiences, and much increased productivity. Because of all this, GraphQL is typically used as a replacement for (or companion to) RESTful API services.
|
|
51
|
-
|
|
52
|
-
**PostgreSQL** is the self-proclaimed “world’s most advanced open source database,” with each new release bringing more amazing features and performance gains. Thinking of your database as a plain CRUD store is now an archaic viewpoint as modern PostgreSQL can do so much for you — from authorization with Row-Level Security (RLS, introduced in PG9.5), through Foreign Data Wrappers (FDW), to real time notifications with `LISTEN`/`NOTIFY`.
|
|
53
|
-
|
|
54
|
-
**PostGraphile** pairs these two incredible technologies together, helping you not only build applications more rapidly, but to build lightning-fast applications. PostGraphile allows you to access the power of PostgreSQL through a well designed, extensible, customisable and incredibly performant GraphQL server. It automatically detects tables, columns, indexes, relationships, views, types, functions, comments, and more - providing a GraphQL server that is highly intelligent about your data, and that automatically updates itself without restarting when you change your database schema.
|
|
55
|
-
|
|
56
|
-
With PostGraphile, a well designed database schema should serve the basis for a well thought out API. PostgreSQL already has amazing authorization and relationship infrastructure, _why duplicate that logic_ in a custom API? A PostGraphile API is likely to provide a more performant and standards compliant GraphQL API than any created in-house, and can be built in a fraction of the time. Focus on your product and let PostGraphile worry about the API layer. Once you need to expand beyond this, we have a powerful plugin system including many [community contributed plugins](https://www.graphile.org/postgraphile/community-plugins/). For a critical evaluation of PostGraphile to determine if it fits in your tech stack, read [evaluating PostGraphile for your project](https://www.graphile.org/postgraphile/evaluating/).
|
|
57
|
-
|
|
58
|
-
## Introduction
|
|
59
|
-
|
|
60
|
-
Watch a talk by the original author [Caleb](https://twitter.com/calebmer) at GraphQL Summit for a walk-through of building an application with PostGraphile in under 7 minutes. This was using v2 (then called PostGraphQL); we're now up to v4 which has many more bells and whistles!
|
|
61
|
-
|
|
62
|
-
[](https://www.youtube.com/watch?v=b3pwlCDy6vY)
|
|
63
|
-
|
|
64
|
-
Hear from the current maintainer [Benjie](https://twitter.com/benjie) at GraphQL Finland about the benefits of Database-Driven GraphQL Development:
|
|
65
|
-
|
|
66
|
-
[](https://www.youtube.com/watch?v=XDOrhTXd4pE)
|
|
67
|
-
|
|
68
|
-
## Usage
|
|
69
|
-
|
|
70
|
-
**Documentation: [graphile.org/postgraphile](https://graphile.org/postgraphile)**
|
|
71
|
-
|
|
72
|
-
You can use PostGraphile via the CLI, as a Node.js middleware, or use the GraphQL schema directly. Make sure to check out the **[full usage instructions](https://graphile.org/postgraphile/usage/)** on the documentation website. We also have a [PostgreSQL schema design guide](https://www.graphile.org/postgraphile/postgresql-schema-design/) you can follow to build a fully functional PostGraphile API.
|
|
73
|
-
|
|
74
|
-
### CLI
|
|
75
|
-
|
|
76
|
-
To get started you can install PostGraphile globally:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
npm install -g postgraphile
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
…and then just run it! By default, PostGraphile will connect to your local database at `postgres://localhost:5432` and introspect the `public` schema. See [the available CLI flags](https://www.graphile.org/postgraphile/usage-cli/) with:
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
postgraphile --help
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
When you're ready to use PostGraphile for your own project, you're advised to install it locally with `yarn`, and run it with `npx`:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
yarn add postgraphile
|
|
92
|
-
npx postgraphile --help
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
**macOS users**: PostGraphile has used port 5000 by default for 5+ years; recently Apple decided to bind the AirPlay service to port 5000 causing a conflict. Please use the `--port` option to bind to a different port.
|
|
96
|
-
|
|
97
|
-
### Middleware
|
|
98
|
-
|
|
99
|
-
You can also use PostGraphile as [native HTTP, Connect, Express, or Koa (experimental) middleware](https://www.graphile.org/postgraphile/usage-library/), e.g.:
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
yarn add postgraphile
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
```js
|
|
106
|
-
import { createServer } from 'http';
|
|
107
|
-
import postgraphile from 'postgraphile';
|
|
108
|
-
|
|
109
|
-
createServer(postgraphile());
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Check out [hapi-postgraphile](https://github.com/mshick/hapi-postgraphile) if you're interested in using PostGraphile as a [hapi](https://github.com/hapijs/hapi) server plugin.
|
|
113
|
-
|
|
114
|
-
### Docker
|
|
115
|
-
|
|
116
|
-
To run via Docker, simply pass the [CLI options](https://www.graphile.org/postgraphile/usage-cli/) to the Docker container:
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
docker pull graphile/postgraphile
|
|
120
|
-
docker run --init graphile/postgraphile --help
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
E.g. you might run this command (substituting the relevant variables):
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
docker run --init -p 5000:5000 graphile/postgraphile --connection postgres://POSTGRES_USER:POSTGRES_PASSWORD@POSTGRES_HOST:POSTGRES_PORT/POSTGRES_DATABASE --schema app_public --watch
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
**macOS users**: Please use a different port to avoid conflict with AirPlay.
|
|
130
|
-
|
|
131
|
-
## Read More
|
|
132
|
-
|
|
133
|
-
**Full documentation for PostGraphile is located at [graphile.org/postgraphile](https://graphile.org/postgraphile).**
|
|
134
|
-
|
|
135
|
-
PostGraphile features include:
|
|
136
|
-
|
|
137
|
-
- Authorization (security) provided by PostgreSQL:
|
|
138
|
-
- [role-based access control (RBAC)](https://www.postgresql.org/docs/10/static/sql-grant.html)
|
|
139
|
-
- [row-level security (RLS)][row-level-security]
|
|
140
|
-
- [Automatic GraphQL relations from SQL relations](https://www.graphile.org/postgraphile/relations/)
|
|
141
|
-
- [PostgreSQL procedure support][procedure documentation]:
|
|
142
|
-
- [Custom queries][advanced queries documentation]
|
|
143
|
-
- [Custom mutations](https://www.graphile.org/postgraphile/custom-mutations/)
|
|
144
|
-
- [Computed columns](https://www.graphile.org/postgraphile/computed-columns/)
|
|
145
|
-
- Development UI (GraphiQL) built in
|
|
146
|
-
- `--watch` mode, auto-detects changes in SQL schema, hot-reloads changes into GraphiQL
|
|
147
|
-
- [Automatic documentation, enhanced by PostgreSQL `COMMENT`s](http://www.postgresql.org/docs/current/static/sql-comment.html)
|
|
148
|
-
- [Schema customisation through smart comments](https://www.graphile.org/postgraphile/smart-comments/)
|
|
149
|
-
- [Simple JWT authentication straight from the database](https://www.graphile.org/postgraphile/security/)
|
|
150
|
-
- [Cursor-based pagination, Relay (classic & modern) compatible](https://www.graphile.org/postgraphile/connections/)
|
|
151
|
-
- Global object identifiers (`nodeId` by default, but Relay-favoured `id` with `--classic-ids`)
|
|
152
|
-
- Relay-compatible mutations
|
|
153
|
-
- [Use direct from the CLI](https://www.graphile.org/postgraphile/usage-cli/)
|
|
154
|
-
- [Use as Express, Connect, or Koa middleware](https://www.graphile.org/postgraphile/usage-library/)
|
|
155
|
-
- [Just use the generated GraphQL schema](https://www.graphile.org/postgraphile/usage-schema/)
|
|
156
|
-
|
|
157
|
-
[procedure documentation]: https://www.graphile.org/postgraphile/procedures/
|
|
158
|
-
[advanced queries documentation]: https://www.graphile.org/postgraphile/custom-queries/
|
|
159
|
-
[row-level-security]: http://www.postgresql.org/docs/current/static/ddl-rowsecurity.html
|
|
160
|
-
|
|
161
|
-
## Requirements
|
|
162
|
-
|
|
163
|
-
[Full requirements are on the website](https://www.graphile.org/postgraphile/requirements/), but a basic summary is:
|
|
164
|
-
|
|
165
|
-
- Node v8.6+
|
|
166
|
-
- PostgreSQL 9.6+ (officially; but currently works with 9.4+)
|
|
167
|
-
- Linux, macOS or Windows
|
|
168
|
-
|
|
169
|
-
Caveats:
|
|
170
|
-
|
|
171
|
-
- PostGraphile does not have automated tests on Windows, if you notice any
|
|
172
|
-
issues please file them (or send a PR!)
|
|
173
|
-
|
|
174
|
-
## Supporting PostGraphile
|
|
175
|
-
|
|
176
|
-
The fastest and easiest way you can help PostGraphile thrive is by [sponsoring
|
|
177
|
-
ongoing development and maintenance](https://graphile.org/sponsor/).
|
|
178
|
-
|
|
179
|
-
Want to help testing and developing PostGraphile? Check out the [contributing
|
|
180
|
-
document](CONTRIBUTING.md) to get started quickly!
|
|
181
|
-
|
|
182
|
-
Commercial support, consultancy and development services are available direct
|
|
183
|
-
from the maintainer; see [Professional Services](https://www.graphile.org/support/)
|
|
184
|
-
for more information, or get in touch!
|
|
185
|
-
|
|
186
|
-
The maintainer of this project is [@Benjie](https://twitter.com/benjie) -
|
|
187
|
-
follow him on Twitter!
|
|
188
|
-
|
|
189
|
-
## Thanks
|
|
190
|
-
|
|
191
|
-
Huge thanks to [the individuals and companies who sponsor PostGraphile's
|
|
192
|
-
development](SPONSORS.md) - their financial contributions enable more time to
|
|
193
|
-
be spent on the project: from bug fixes, to code review, to new features! If
|
|
194
|
-
you want to help the project advance more rapidly, please join them in
|
|
195
|
-
[supporting this project](https://graphile.org/sponsor/) 🙏
|
|
196
|
-
|
|
197
|
-
A humongous, heart-felt, thank you to the original author of PostGraphile -
|
|
198
|
-
[Caleb Meredith](https://twitter.com/calebmer) - for everything he put into
|
|
199
|
-
PostGraphile! He's now graduated from the project and we all wish him the best
|
|
200
|
-
for his future ventures!
|
|
201
|
-
|
|
202
|
-
Thanks also to the people working on
|
|
203
|
-
[PostgREST](https://github.com/begriffs/postgrest) which was a huge inspiration
|
|
204
|
-
for this project!
|
|
205
|
-
|
|
206
|
-
Thanks and enjoy 👍
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-run.d.ts","sourceRoot":"","sources":["../src/cli-run.ts"],"names":[],"mappings":""}
|
package/dist/cli-run.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const cli_1 = require("graphile-config/cli");
|
|
5
|
+
const cli_js_1 = require("./cli.js");
|
|
6
|
+
(0, cli_1.runCli)(cli_js_1.options, cli_js_1.run);
|
|
7
|
+
//# sourceMappingURL=cli-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-run.js","sourceRoot":"","sources":["../src/cli-run.ts"],"names":[],"mappings":";;;AACA,6CAA6C;AAE7C,qCAAwC;AAExC,IAAA,YAAM,EAAC,gBAAO,EAAE,YAAG,CAAC,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="yargs" />
|
|
2
|
+
import type { ArgsFromOptions, Argv } from "graphile-config/cli";
|
|
3
|
+
export declare function options(yargs: Argv): Argv<{
|
|
4
|
+
connection: string | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
schema: string | undefined;
|
|
7
|
+
} & {
|
|
8
|
+
watch: boolean;
|
|
9
|
+
} & {
|
|
10
|
+
port: number | undefined;
|
|
11
|
+
} & {
|
|
12
|
+
host: string;
|
|
13
|
+
} & {
|
|
14
|
+
config: string | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
preset: string | undefined;
|
|
17
|
+
} & {
|
|
18
|
+
"allow-explain": boolean | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function run(args: ArgsFromOptions<typeof options>): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAWjE,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI;;;;;;;;;;;;;;;;GAwDlC;AAkCD,wBAAsB,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,OAAO,OAAO,CAAC,iBAkH9D"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.run = exports.options = void 0;
|
|
4
|
+
const graphile_config_1 = require("graphile-config");
|
|
5
|
+
const load_1 = require("graphile-config/load");
|
|
6
|
+
const node_http_1 = require("node:http");
|
|
7
|
+
const node_util_1 = require("node:util");
|
|
8
|
+
const index_js_1 = require("./index.js");
|
|
9
|
+
const schema_js_1 = require("./schema.js");
|
|
10
|
+
// The preset we recommend if the user doesn't specify one
|
|
11
|
+
const RECOMMENDED_PRESET = "--preset postgraphile/presets/amber";
|
|
12
|
+
function options(yargs) {
|
|
13
|
+
return yargs
|
|
14
|
+
.parserConfiguration({
|
|
15
|
+
// Last option wins - do NOT make duplicates into arrays!
|
|
16
|
+
"duplicate-arguments-array": false,
|
|
17
|
+
})
|
|
18
|
+
.usage("$0", "Run a PostGraphile HTTP server")
|
|
19
|
+
.example("$0 --connection postgres://localhost:5432/dbname --schema public --allow-explain", "Run PostGraphile connecting to the given PostgreSQL connection string, exposing the 'public' schema as GraphQL and allowing clients to request details of what went on 'under the hood' when executing operations ('explain')")
|
|
20
|
+
.option("connection", {
|
|
21
|
+
alias: "c",
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "The PostgreSQL connection string to connect to",
|
|
24
|
+
})
|
|
25
|
+
.option("schema", {
|
|
26
|
+
alias: "s",
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "The database schema (or comma separated list of schemas) to expose over GraphQL",
|
|
29
|
+
})
|
|
30
|
+
.option("watch", {
|
|
31
|
+
alias: "w",
|
|
32
|
+
type: "boolean",
|
|
33
|
+
description: "Watch mode (monitor DB for schema changes)",
|
|
34
|
+
default: false,
|
|
35
|
+
})
|
|
36
|
+
.option("port", {
|
|
37
|
+
alias: "p",
|
|
38
|
+
type: "number",
|
|
39
|
+
description: "The port number on which to run our HTTP server",
|
|
40
|
+
})
|
|
41
|
+
.option("host", {
|
|
42
|
+
alias: "n",
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "The host to bind our HTTP server to",
|
|
45
|
+
default: "localhost",
|
|
46
|
+
})
|
|
47
|
+
.option("config", {
|
|
48
|
+
alias: "C",
|
|
49
|
+
type: "string",
|
|
50
|
+
description: "The path to the config file",
|
|
51
|
+
normalize: true,
|
|
52
|
+
})
|
|
53
|
+
.option("preset", {
|
|
54
|
+
alias: "P",
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "A comma separated list of the preset(s) to use",
|
|
57
|
+
})
|
|
58
|
+
.option("allow-explain", {
|
|
59
|
+
alias: "e",
|
|
60
|
+
type: "boolean",
|
|
61
|
+
description: "Allow visitors to view the plan/SQL queries/etc related to each GraphQL operation",
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
exports.options = options;
|
|
65
|
+
function isGraphileConfigPreset(foo) {
|
|
66
|
+
if (typeof foo !== "object")
|
|
67
|
+
return false;
|
|
68
|
+
if (foo === null)
|
|
69
|
+
return false;
|
|
70
|
+
const prototype = Object.getPrototypeOf(foo);
|
|
71
|
+
if (prototype === null || prototype === Object.prototype) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
async function loadPresets(presetSpecs) {
|
|
77
|
+
const specs = presetSpecs.split(",");
|
|
78
|
+
const presets = [];
|
|
79
|
+
for (const spec of specs) {
|
|
80
|
+
const [moduleName, exportName = "default"] = spec.split(":");
|
|
81
|
+
const mod = await import(moduleName);
|
|
82
|
+
const possiblePreset = mod[exportName];
|
|
83
|
+
if (isGraphileConfigPreset(possiblePreset)) {
|
|
84
|
+
presets.push(possiblePreset);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
throw new Error(`Imported '${spec}' but the '${exportName}' export doesn't look like a preset: ${(0, node_util_1.inspect)(spec)}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return presets;
|
|
91
|
+
}
|
|
92
|
+
async function run(args) {
|
|
93
|
+
const { connection: connectionString, schema: rawSchema, port: rawPort, host: rawHost, config: configFileLocation, allowExplain: rawAllowExplain, watch, preset: rawPresets, } = args;
|
|
94
|
+
const cliPresets = rawPresets ? await loadPresets(rawPresets) : [];
|
|
95
|
+
// Try and load the preset
|
|
96
|
+
const userPreset = await (0, load_1.loadConfig)(configFileLocation);
|
|
97
|
+
const preset = {
|
|
98
|
+
extends: [...(userPreset ? [userPreset] : []), ...cliPresets],
|
|
99
|
+
};
|
|
100
|
+
if (preset.extends.length === 0) {
|
|
101
|
+
console.error(`ERROR: You must either specify a --preset or have a \`graphile.config.js\` file that provides one. One option is to add \`${RECOMMENDED_PRESET}\` to your command line:\n\n postgraphile ${RECOMMENDED_PRESET}${process.argv.length > 2 ? ` ${process.argv.slice(2).join(" ")}` : ""}`);
|
|
102
|
+
process.exit(1);
|
|
103
|
+
}
|
|
104
|
+
// Apply CLI options to preset
|
|
105
|
+
if (connectionString || rawSchema) {
|
|
106
|
+
const schemas = rawSchema?.split(",") ?? ["public"];
|
|
107
|
+
const newPgSources = (0, schema_js_1.makePgSources)(connectionString, schemas);
|
|
108
|
+
preset.pgSources = newPgSources;
|
|
109
|
+
}
|
|
110
|
+
preset.server = preset.server || {};
|
|
111
|
+
if (rawPort != null) {
|
|
112
|
+
preset.server.port = rawPort;
|
|
113
|
+
}
|
|
114
|
+
if (rawHost != null) {
|
|
115
|
+
preset.server.host = rawHost;
|
|
116
|
+
}
|
|
117
|
+
preset.grafast = preset.grafast || {};
|
|
118
|
+
if (rawAllowExplain != null) {
|
|
119
|
+
preset.grafast.explain = rawAllowExplain;
|
|
120
|
+
}
|
|
121
|
+
if (watch != null) {
|
|
122
|
+
preset.server.watch = watch;
|
|
123
|
+
}
|
|
124
|
+
const config = (0, graphile_config_1.resolvePresets)([preset]);
|
|
125
|
+
if (!config.pgSources || config.pgSources.length === 0) {
|
|
126
|
+
// TODO: respect envvars here?
|
|
127
|
+
console.error(`ERROR: Please specify \`--connection\` so we know which database to connect to (or add details to your \`graphile.config.js\`):\n\n postgraphile${process.argv.length > 2 ? ` ${process.argv.slice(2).join(" ")}` : ""} --connection postgres://user:password@server:port/database_name?ssl=true`);
|
|
128
|
+
process.exit(2);
|
|
129
|
+
}
|
|
130
|
+
const instance = (0, index_js_1.postgraphile)(config);
|
|
131
|
+
const serv = await instance.getGrafserv();
|
|
132
|
+
const server = (0, node_http_1.createServer)(serv.handler);
|
|
133
|
+
server.once("listening", () => {
|
|
134
|
+
server.on("error", (e) => {
|
|
135
|
+
console.error("Server raised an error:", e);
|
|
136
|
+
});
|
|
137
|
+
const address = server.address();
|
|
138
|
+
if (typeof address === "string") {
|
|
139
|
+
console.log(`Server listening at ${address}`);
|
|
140
|
+
}
|
|
141
|
+
else if (address) {
|
|
142
|
+
const host = address.family === "IPv6" ? `[${address.address}]` : address.address;
|
|
143
|
+
console.log(`Server listening on port ${address.port} at http://${host}:${address.port}/graphql`);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
console.error(`Could not determine server address`);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
const port = config.server?.port;
|
|
150
|
+
const host = config.server?.host;
|
|
151
|
+
const listenFailed = (e) => {
|
|
152
|
+
// Listen failed; exit
|
|
153
|
+
console.error("Failed to listen", e);
|
|
154
|
+
process.exit(2);
|
|
155
|
+
};
|
|
156
|
+
if (port != null) {
|
|
157
|
+
server.on("error", listenFailed);
|
|
158
|
+
server.once("listening", () => {
|
|
159
|
+
server.removeListener("error", listenFailed);
|
|
160
|
+
});
|
|
161
|
+
server.listen({ port, host });
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
const tryPortZero = () => {
|
|
165
|
+
server.removeListener("error", tryPortZero);
|
|
166
|
+
server.on("error", listenFailed);
|
|
167
|
+
server.once("listening", () => {
|
|
168
|
+
server.removeListener("error", listenFailed);
|
|
169
|
+
});
|
|
170
|
+
server.listen({ host, port: 0 });
|
|
171
|
+
};
|
|
172
|
+
server.on("error", tryPortZero);
|
|
173
|
+
server.once("listening", () => {
|
|
174
|
+
server.removeListener("error", tryPortZero);
|
|
175
|
+
});
|
|
176
|
+
server.listen({ host, port: 5678 });
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
exports.run = run;
|
|
180
|
+
//# sourceMappingURL=cli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E,GAAG,EAAE;YAC5B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;KAC/B;SAAM;QACL,MAAM,WAAW,GAAG,GAAG,EAAE;YACvB,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;YAC5C,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YACjC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;gBAC5B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACnC,CAAC,CAAC;QACF,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAChC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;YAC5B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;KACrC;AACH,CAAC;AAlHD,kBAkHC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "graphile-build";
|
|
2
|
+
import "graphile-build-pg";
|
|
3
|
+
import type { Grafserv, ServerParams } from "grafserv";
|
|
4
|
+
import type { GraphQLSchema } from "graphql";
|
|
5
|
+
export { makePgSources, makeSchema } from "./schema.js";
|
|
6
|
+
export { GraphileBuild, GraphileConfig };
|
|
7
|
+
export declare function postgraphile(preset: GraphileConfig.Preset): {
|
|
8
|
+
getGrafserv(): Promise<Grafserv>;
|
|
9
|
+
getServerParams(): Promise<ServerParams>;
|
|
10
|
+
getSchema(): Promise<GraphQLSchema>;
|
|
11
|
+
release(): Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export default postgraphile;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,CAAC;AACxB,OAAO,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;AAEzC,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,GAAG;IAC3D,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjC,eAAe,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IACzC,SAAS,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IACpC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B,CAgFA;AAED,eAAe,YAAY,CAAC"}
|