graphile-plugin-fulltext-filter 2.0.3 โ†’ 2.0.4

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 +18 -11
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -16,15 +16,23 @@
16
16
  </a>
17
17
  </p>
18
18
 
19
- Full text searching on `tsvector` fields for use with `graphile-plugin-connection-filter`. This plugin implements a full text search operator for `tsvector` columns in PostGraphile v4.
19
+ **`graphile-plugin-fulltext-filter`** adds full-text search operators for `tsvector` fields to `graphile-plugin-connection-filter` in PostGraphile v4.
20
20
 
21
- ## Install
21
+ ## ๐Ÿš€ Installation
22
22
 
23
23
  ```sh
24
24
  pnpm add graphile-plugin-fulltext-filter
25
25
  ```
26
26
 
27
- ## Usage
27
+ ## โœจ Features
28
+
29
+ - Adds a `matches` operator for `tsvector` columns in PostGraphile v4
30
+ - Works alongside `graphile-plugin-connection-filter`
31
+ - Generates rank fields for ordering results (`fullTextRank`)
32
+ - CLI and library-friendly setup
33
+ - Uses `pg-tsquery` to safely parse user input
34
+
35
+ ## ๐Ÿ“ฆ Usage
28
36
 
29
37
  ### CLI
30
38
 
@@ -56,7 +64,7 @@ app.use(
56
64
  app.listen(5000);
57
65
  ```
58
66
 
59
- ## Performance
67
+ ## โšก Performance
60
68
 
61
69
  All `tsvector` columns that aren't `@omit`'d should have indexes on them:
62
70
 
@@ -65,19 +73,19 @@ ALTER TABLE posts ADD COLUMN full_text tsvector;
65
73
  CREATE INDEX full_text_idx ON posts USING gin(full_text);
66
74
  ```
67
75
 
68
- ## Operators
76
+ ## ๐Ÿ”Ž Operators
69
77
 
70
78
  This plugin adds the `matches` filter operator to the filter plugin, accepting a GraphQL String input and using the `@@` operator to perform full-text searches on `tsvector` columns.
71
79
 
72
80
  This plugin uses [pg-tsquery](https://github.com/caub/pg-tsquery) to parse the user input to prevent Postgres throwing on bad user input unnecessarily.
73
81
 
74
- ## Fields
82
+ ## ๐Ÿงญ Fields
75
83
 
76
84
  For each `tsvector` column, a rank column will be automatically added to the GraphQL type for the table by appending `Rank` to the end of the column's name. For example, a column `full_text` will appear as `fullText` in the GraphQL type, and a second column, `fullTextRank` will be added to the type as a `Float`.
77
85
 
78
86
  This rank field can be used for ordering and is automatically added to the orderBy enum for the table.
79
87
 
80
- ## Examples
88
+ ## ๐Ÿงช Examples
81
89
 
82
90
  ```graphql
83
91
  query {
@@ -93,14 +101,13 @@ query {
93
101
  }
94
102
  ```
95
103
 
96
- ## Testing
104
+ ## ๐Ÿงช Testing
97
105
 
98
106
  ```sh
99
- pnpm test
107
+ # requires a local Postgres available (defaults to postgres/password@localhost:5432)
108
+ pnpm --filter graphile-plugin-fulltext-filter test
100
109
  ```
101
110
 
102
- Tests expect a running PostgreSQL instance. See test configuration for database connection details.
103
-
104
111
  ---
105
112
 
106
113
  ## Education and Tutorials
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-plugin-fulltext-filter",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Full text searching on tsvector fields for use with graphile-plugin-connection-filter",
5
5
  "main": "index.js",
6
6
  "module": "esm/index.js",
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "graphile-build": "^4.14.1",
44
44
  "graphile-build-pg": "^4.14.1",
45
- "graphile-plugin-connection-filter": "^2.3.2",
45
+ "graphile-plugin-connection-filter": "^2.3.3",
46
46
  "pg-tsquery": "^8.1.0"
47
47
  },
48
48
  "peerDependencies": {
@@ -51,10 +51,10 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "graphile-plugin-connection-filter": "workspace:^",
54
- "graphile-test": "^2.8.10",
54
+ "graphile-test": "^2.8.11",
55
55
  "graphql": "15.10.1",
56
56
  "makage": "^0.1.8",
57
- "pgsql-test": "^2.14.13"
57
+ "pgsql-test": "^2.14.14"
58
58
  },
59
- "gitHead": "4e1ff9771c2b07808a9830281abc24d12c689187"
59
+ "gitHead": "00c90828cab8d3e306ebb2bc6053aab4aa9ae807"
60
60
  }