graphile-meta-schema 0.2.11 โ†’ 0.2.12

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.
Files changed (2) hide show
  1. package/README.md +31 -11
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -16,13 +16,41 @@
16
16
  </a>
17
17
  </p>
18
18
 
19
- ## Install
19
+ **`graphile-meta-schema`** exposes a `_meta` GraphQL schema so you can introspect tables, fields, and constraints directly from PostGraphile.
20
+
21
+ ## ๐Ÿš€ Installation
20
22
 
21
23
  ```sh
22
24
  pnpm add graphile-meta-schema
23
25
  ```
24
26
 
25
- ## Example Query
27
+ ## โœจ Features
28
+
29
+ - GraphQL meta endpoint for table/field/constraint details
30
+ - Works alongside your existing PostGraphile schemas
31
+ - Ships with fixtures to explore constraint metadata
32
+
33
+ ## ๐Ÿ“ฆ Usage
34
+
35
+ Register the plugin with PostGraphile (CLI or library):
36
+
37
+ ```ts
38
+ import express from 'express';
39
+ import { postgraphile } from 'postgraphile';
40
+ import PgMetaschemaPlugin from 'graphile-meta-schema';
41
+
42
+ const app = express();
43
+
44
+ app.use(
45
+ postgraphile(process.env.DATABASE_URL, ['app_public'], {
46
+ appendPlugins: [PgMetaschemaPlugin]
47
+ })
48
+ );
49
+ ```
50
+
51
+ The plugin adds a `_meta` query root alongside your existing schemas. Use it to inspect fields, constraints, relations, and generated inflection.
52
+
53
+ ### Example Query
26
54
 
27
55
  ```gql
28
56
  query MetaQuery {
@@ -88,21 +116,13 @@ query MetaQuery {
88
116
  }
89
117
  ```
90
118
 
91
- ## Testing
119
+ ## ๐Ÿงช Testing
92
120
 
93
121
  ```sh
94
122
  # requires a local Postgres with PostGIS available (defaults to postgres/password@localhost:5432)
95
123
  pnpm --filter graphile-meta-schema test
96
124
  ```
97
125
 
98
- If you want to explore the fixtures manually:
99
-
100
- ```sh
101
- createdb metaschema_example
102
- psql metaschema_example < sql/test.sql
103
- psql metaschema_example < sql/types.sql
104
- ```
105
-
106
126
  ---
107
127
 
108
128
  ## Education and Tutorials
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-meta-schema",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "graphile meta schema",
5
5
  "author": "Dan Lynch <pyramation@gmail.com>",
6
6
  "homepage": "https://github.com/launchql/launchql",
@@ -40,10 +40,10 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@graphile-contrib/pg-many-to-many": "^1.0.0",
43
- "graphile-test": "^2.8.10",
43
+ "graphile-test": "^2.8.11",
44
44
  "graphql-tag": "2.12.6",
45
45
  "makage": "^0.1.8",
46
- "pgsql-test": "^2.14.13"
46
+ "pgsql-test": "^2.14.14"
47
47
  },
48
48
  "dependencies": {
49
49
  "graphile-build": "^4.14.1",
@@ -51,5 +51,5 @@
51
51
  "graphile-utils": "^4.14.1",
52
52
  "graphql": "15.10.1"
53
53
  },
54
- "gitHead": "4e1ff9771c2b07808a9830281abc24d12c689187"
54
+ "gitHead": "00c90828cab8d3e306ebb2bc6053aab4aa9ae807"
55
55
  }