graphile-plugin-connection-filter 2.3.2 โ†’ 2.3.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.
Files changed (2) hide show
  1. package/README.md +26 -28
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -16,27 +16,40 @@
16
16
  </a>
17
17
  </p>
18
18
 
19
- Adds a powerful suite of filtering capabilities to a PostGraphile schema.
19
+ **`graphile-plugin-connection-filter`** adds a powerful suite of filtering capabilities to PostGraphile schemas.
20
20
 
21
21
  > **Warning:** Use of this plugin with the default options may make it **astoundingly trivial** for a malicious actor (or a well-intentioned application that generates complex GraphQL queries) to overwhelm your database with expensive queries. See the [Performance and Security](https://github.com/graphile-contrib/graphile-plugin-connection-filter#performance-and-security) section below for details.
22
22
 
23
- ## Usage
23
+ ## ๐Ÿš€ Installation
24
24
 
25
25
  Requires PostGraphile v4.5.0 or higher.
26
26
 
27
27
  Install with:
28
28
 
29
29
  ```
30
- yarn add postgraphile graphile-plugin-connection-filter
30
+ pnpm add postgraphile graphile-plugin-connection-filter
31
31
  ```
32
32
 
33
- CLI usage via `--append-plugins`:
33
+ ## โœจ Features
34
+
35
+ This plugin supports filtering on almost all PostgreSQL types, including complex types such as domains, ranges, arrays, and composite types. For details on the specific operators supported for each type, see [docs/operators.md](https://github.com/graphile-contrib/graphile-plugin-connection-filter/blob/master/docs/operators.md).
36
+
37
+ See also:
38
+
39
+ - [@graphile/pg-aggregates](https://github.com/graphile/pg-aggregates) - integrates with this plugin to enable powerful aggregate filtering
40
+ - [graphile-plugin-connection-filter-postgis](https://github.com/launchql/launchql/tree/main/graphile/graphile-plugin-connection-filter-postgis) - adds PostGIS functions and operators for filtering on `geography`/`geometry` columns
41
+ - [postgraphile-plugin-fulltext-filter](https://github.com/mlipscombe/postgraphile-plugin-fulltext-filter) - adds a full text search operator for filtering on `tsvector` columns
42
+ - [postgraphile-plugin-unaccented-text-search-filter](https://github.com/spacefill/postgraphile-plugin-unaccented-text-search-filter) - adds unaccent text search operators
43
+
44
+ ## ๐Ÿ“ฆ Usage
45
+
46
+ ### CLI usage via `--append-plugins`:
34
47
 
35
48
  ```
36
49
  postgraphile --append-plugins graphile-plugin-connection-filter -c postgres://localhost/my_db ...
37
50
  ```
38
51
 
39
- Library usage via `appendPlugins`:
52
+ ### Library usage via `appendPlugins`:
40
53
 
41
54
  ```ts
42
55
  import ConnectionFilterPlugin from "graphile-plugin-connection-filter";
@@ -47,7 +60,7 @@ const middleware = postgraphile(DATABASE_URL, SCHEMAS, {
47
60
  });
48
61
  ```
49
62
 
50
- ## Performance and Security
63
+ ## โš ๏ธ Performance and Security
51
64
 
52
65
  By default, this plugin:
53
66
 
@@ -65,24 +78,13 @@ To protect your server, you can:
65
78
 
66
79
  Also see the [Production Considerations](https://www.graphile.org/postgraphile/production) page of the official PostGraphile docs, which discusses query whitelisting.
67
80
 
68
- ## Features
69
-
70
- This plugin supports filtering on almost all PostgreSQL types, including complex types such as domains, ranges, arrays, and composite types. For details on the specific operators supported for each type, see [docs/operators.md](https://github.com/graphile-contrib/graphile-plugin-connection-filter/blob/master/docs/operators.md).
71
-
72
- See also:
73
-
74
- - [@graphile/pg-aggregates](https://github.com/graphile/pg-aggregates) - integrates with this plugin to enable powerful aggregate filtering
75
- - [graphile-plugin-connection-filter-postgis](https://github.com/launchql/launchql/tree/main/graphile/graphile-plugin-connection-filter-postgis) - adds PostGIS functions and operators for filtering on `geography`/`geometry` columns
76
- - [postgraphile-plugin-fulltext-filter](https://github.com/mlipscombe/postgraphile-plugin-fulltext-filter) - adds a full text search operator for filtering on `tsvector` columns
77
- - [postgraphile-plugin-unaccented-text-search-filter](https://github.com/spacefill/postgraphile-plugin-unaccented-text-search-filter) - adds unaccent text search operators
78
-
79
- ## Handling `null` and empty objects
81
+ ## ๐Ÿšฆ Handling `null` and empty objects
80
82
 
81
83
  By default, this plugin will throw an error when `null` literals or empty objects (`{}`) are included in `filter` input objects. This prevents queries with ambiguous semantics such as `filter: { field: null }` and `filter: { field: { equalTo: null } }` from returning unexpected results. For background on this decision, see https://github.com/graphile-contrib/graphile-plugin-connection-filter/issues/58.
82
84
 
83
85
  To allow `null` and `{}` in inputs, use the `connectionFilterAllowNullInput` and `connectionFilterAllowEmptyObjectInput` options documented under [Plugin Options](https://github.com/graphile-contrib/graphile-plugin-connection-filter#plugin-options). Please note that even with `connectionFilterAllowNullInput` enabled, `null` is never interpreted as a SQL `NULL`; fields with `null` values are simply ignored when resolving the query.
84
86
 
85
- ## Plugin Options
87
+ ## ๐Ÿ”ง Plugin Options
86
88
 
87
89
  When using PostGraphile as a library, the following plugin options can be passed via `graphileBuildOptions`:
88
90
 
@@ -265,7 +267,7 @@ postgraphile(pgConfig, schema, {
265
267
  });
266
268
  ```
267
269
 
268
- ## Examples
270
+ ## ๐Ÿงช Examples
269
271
 
270
272
  ```graphql
271
273
  query {
@@ -279,15 +281,11 @@ query {
279
281
 
280
282
  For an extensive set of examples, see [docs/examples.md](https://github.com/graphile-contrib/graphile-plugin-connection-filter/blob/master/docs/examples.md).
281
283
 
282
- ## Development
283
-
284
- To establish a test environment, create an empty PostgreSQL database with C collation (required for consistent ordering of strings) and set a `TEST_DATABASE_URL` environment variable with your database connection string.
284
+ ## ๐Ÿงช Testing
285
285
 
286
- ```bash
287
- createdb graphile_test_c --template template0 --lc-collate C
288
- export TEST_DATABASE_URL=postgres://localhost:5432/graphile_test_c
289
- yarn
290
- yarn test
286
+ ```sh
287
+ # requires a local Postgres available (defaults to postgres/password@localhost:5432)
288
+ pnpm --filter graphile-plugin-connection-filter test
291
289
  ```
292
290
 
293
291
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-plugin-connection-filter",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "description": "Filtering on PostGraphile connections",
5
5
  "author": "Matt Bretl",
6
6
  "homepage": "https://github.com/launchql/launchql",
@@ -49,10 +49,10 @@
49
49
  "devDependencies": {
50
50
  "@graphile-contrib/pg-simplify-inflector": "^6.1.0",
51
51
  "@types/pg": "^8.15.6",
52
- "graphile-test": "^2.8.10",
52
+ "graphile-test": "^2.8.11",
53
53
  "makage": "^0.1.6",
54
54
  "pg": "^8.16.0",
55
- "pgsql-test": "^2.14.13"
55
+ "pgsql-test": "^2.14.14"
56
56
  },
57
- "gitHead": "4e1ff9771c2b07808a9830281abc24d12c689187"
57
+ "gitHead": "00c90828cab8d3e306ebb2bc6053aab4aa9ae807"
58
58
  }