Skip to content

Commit 18a2581

Browse files
committed
Replace connectionFilterUsesShortNames option with connectionFilterOperatorNames
1 parent 9144a90 commit 18a2581

File tree

6 files changed

+2857
-36
lines changed

6 files changed

+2857
-36
lines changed

README.md

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This plugin targets the alpha release of PostGraphile v4. Bug reports and pull
1212
| 4.0.0-alpha2.20 | 1.0.0-alpha.0 |
1313
| 4.0.0-alpha2.21 - 4.0.0-alpha2.25 | 1.0.0-alpha.1 |
1414
| 4.0.0-alpha2.26 | 1.0.0-alpha.2 - 1.0.0-alpha.3 |
15-
| 4.0.0-alpha2.27 - 4.0.0-alpha2.28 | 1.0.0-alpha.4 - 1.0.0-alpha.5 |
15+
| 4.0.0-alpha2.27 - 4.0.0-alpha2.28 | 1.0.0-alpha.4 - 1.0.0-alpha.6 |
1616

1717
## Getting Started
1818

@@ -174,18 +174,58 @@ For additional examples, see the [tests](https://github.com/mattbretl/postgraphi
174174

175175
When using PostGraphile as a library, the following plugin options can be passed via `graphileBuildOptions` (called `graphqlBuildOptions` in PostGraphile 4.0.0-alpha2.20 and earlier):
176176

177-
### connectionFilterUsesShortNames
178-
Use short names (e.g. eq, ne, lt, lte) for operators
177+
### connectionFilterOperatorNames
178+
179+
Use alternative names (e.g. `eq`, `ne`) for operators
179180
``` js
180181
postgraphile(pgConfig, schema, {
181182
...
182183
graphileBuildOptions: {
183-
connectionFilterUsesShortNames: true,
184+
connectionFilterOperatorNames: {
185+
equalTo: "eq",
186+
notEqualTo: "ne",
187+
},
188+
},
189+
})
190+
```
191+
192+
Note: The `connectionFilterUsesShortNames` option was removed in v1.0.0-alpha.6. To restore the old functionality, you can use this:
193+
``` js
194+
postgraphile(pgConfig, schema, {
195+
...
196+
graphileBuildOptions: {
197+
connectionFilterOperatorNames: {
198+
equalTo: "eq",
199+
notEqualTo: "ne",
200+
lessThan: "lt",
201+
lessThanOrEqualTo: "lte",
202+
greaterThan: "gt",
203+
greaterThanOrEqualTo: "gte",
204+
in: "in",
205+
notIn: "nin",
206+
contains: "cont",
207+
notContains: "ncont",
208+
containsInsensitive: "conti",
209+
notContainsInsensitive: "nconti",
210+
startsWith: "starts",
211+
notStartsWith: "nstarts",
212+
startsWithInsensitive: "startsi",
213+
notStartsWithInsensitive: "nstartsi",
214+
endsWith: "ends",
215+
notEndsWith: "nends",
216+
endsWithInsensitive: "endsi",
217+
notEndsWithInsensitive: "nendsi",
218+
like: "like",
219+
notLike: "nlike",
220+
likeInsensitive: "ilike",
221+
notLikeInsensitive: "nilike"
222+
},
184223
},
185224
})
186225
```
187226

188227
### connectionFilterAllowedFieldTypes
228+
189229
Restrict filters to specific field types
190230
``` js
191231
postgraphile(pgConfig, schema, {

0 commit comments

Comments
 (0)