graphile-simple-inflector 0.1.8 → 0.1.10
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/README.md +19 -11
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -8,18 +8,30 @@
|
|
|
8
8
|
<a href="https://github.com/launchql/launchql/actions/workflows/run-tests.yaml">
|
|
9
9
|
<img height="20" src="https://github.com/launchql/launchql/actions/workflows/run-tests.yaml/badge.svg" />
|
|
10
10
|
</a>
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
<a href="https://github.com/launchql/launchql/blob/main/LICENSE">
|
|
12
|
+
<img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/>
|
|
13
|
+
</a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/graphile-simple-inflector">
|
|
15
|
+
<img height="20" src="https://img.shields.io/github/package-json/v/launchql/launchql?filename=graphile%2Fgraphile-simple-inflector%2Fpackage.json"/>
|
|
16
|
+
</a>
|
|
13
17
|
</p>
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
**`graphile-simple-inflector`** simplifies Graphile/PostGraphile naming by shortening common fields (e.g. `tableByNodeId` → `table`) and keeping pluralization predictable for numeric suffixes.
|
|
16
20
|
|
|
17
|
-
##
|
|
21
|
+
## 🚀 Installation
|
|
18
22
|
|
|
19
23
|
```sh
|
|
20
24
|
pnpm add graphile-simple-inflector
|
|
21
25
|
```
|
|
22
26
|
|
|
27
|
+
## ✨ Features
|
|
28
|
+
|
|
29
|
+
- Shorter, predictable field names (`tableByNodeId` → `table`)
|
|
30
|
+
- Smarter pluralization for numeric suffixes
|
|
31
|
+
- Designed to pair with PostGraphile simplify options
|
|
32
|
+
|
|
33
|
+
## 📦 Usage
|
|
34
|
+
|
|
23
35
|
When using PostGraphile:
|
|
24
36
|
|
|
25
37
|
```ts
|
|
@@ -34,17 +46,13 @@ createPostGraphileSchema(pool, ['app_public'], {
|
|
|
34
46
|
});
|
|
35
47
|
```
|
|
36
48
|
|
|
37
|
-
## Testing
|
|
38
|
-
|
|
39
|
-
Tests expect a running PostgreSQL instance (see `utils/env.ts` for defaults). Seed the test database with the provided fixtures or let the test harness create them automatically:
|
|
49
|
+
## 🧪 Testing
|
|
40
50
|
|
|
41
51
|
```sh
|
|
42
|
-
|
|
43
|
-
pnpm
|
|
52
|
+
# requires a local Postgres available (defaults to postgres/password@localhost:5432)
|
|
53
|
+
pnpm --filter graphile-simple-inflector test
|
|
44
54
|
```
|
|
45
55
|
|
|
46
|
-
The included SQL under `sql/` matches the original package's fixtures.
|
|
47
|
-
|
|
48
56
|
---
|
|
49
57
|
|
|
50
58
|
## Education and Tutorials
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-simple-inflector",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Simple inflector plugin for Graphile/PostGraphile",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/launchql/launchql",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"url": "https://github.com/launchql/launchql/issues"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"graphile-test": "^2.8.
|
|
42
|
+
"graphile-test": "^2.8.11",
|
|
43
43
|
"graphql-tag": "2.12.6",
|
|
44
44
|
"makage": "^0.1.8",
|
|
45
|
-
"pgsql-test": "^2.14.
|
|
45
|
+
"pgsql-test": "^2.14.14"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"graphile-build": "^4.14.1"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "00c90828cab8d3e306ebb2bc6053aab4aa9ae807"
|
|
51
51
|
}
|