Skip to content

Commit ed65dc3

Browse files
committed
More README updates
1 parent 0055c39 commit ed65dc3

File tree

1 file changed

+76
-20
lines changed

1 file changed

+76
-20
lines changed

README.md

Lines changed: 76 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ The following filter operators are exposed by default:
103103

104104
## Examples
105105

106-
### Null values
106+
<details>
107+
<summary>Null values</summary>
108+
<br>
109+
NOTE: The syntax for filtering null values will be standardized before the v1.0.0 release. There are currently two options:
107110

108111
``` graphql
109112
query {
@@ -115,7 +118,21 @@ query {
115118
}
116119
```
117120

118-
### Non-null values
121+
``` graphql
122+
query {
123+
allPosts(filter: {
124+
body: { is: NULL }
125+
}) {
126+
...
127+
}
128+
}
129+
```
130+
</details>
131+
132+
<details>
133+
<summary>Non-null values</summary>
134+
<br>
135+
NOTE: The syntax for filtering null values will standardized before the v1.0.0 release. There are currently two options:
119136

120137
``` graphql
121138
query {
@@ -127,7 +144,20 @@ query {
127144
}
128145
```
129146

130-
### Comparison operator with scalar input
147+
``` graphql
148+
query {
149+
allPosts(filter: {
150+
body: { is: NOT_NULL }
151+
}) {
152+
...
153+
}
154+
}
155+
```
156+
</details>
157+
158+
<details>
159+
<summary>Comparison operator with scalar input</summary>
160+
<br>
131161
``` graphql
132162
query {
133163
allPosts(filter: {
@@ -137,8 +167,11 @@ query {
137167
}
138168
}
139169
```
170+
</details>
140171

141-
### Comparison operator with array input
172+
<details>
173+
<summary>Comparison operator with array input</summary>
174+
<br>
142175
``` graphql
143176
query {
144177
allPosts(filter: {
@@ -148,8 +181,13 @@ query {
148181
}
149182
}
150183
```
184+
</details>
185+
186+
<details>
187+
<summary>Multiple comparison operators</summary>
188+
<br>
189+
Note: Objects with multiple keys are interpreted with an implicit `AND` between the conditions.
151190

152-
### Multiple comparison operators
153191
``` graphql
154192
query {
155193
allPosts(filter: {
@@ -160,10 +198,11 @@ query {
160198
}
161199
}
162200
```
201+
</details>
163202

164-
Note: Objects with multiple keys are interpreted with an implicit `AND` between the conditions.
165-
166-
### Logical operator
203+
<details>
204+
<summary>Logical operator</summary>
205+
<br>
167206
``` graphql
168207
query {
169208
allPosts(filter: {
@@ -176,9 +215,11 @@ query {
176215
}
177216
}
178217
```
218+
</details>
179219

180-
### Nested logic
181-
220+
<details>
221+
<summary>Nested logic</summary>
222+
<br>
182223
``` graphql
183224
query {
184225
allPosts(filter: {
@@ -193,9 +234,11 @@ query {
193234
}
194235
}
195236
```
237+
</details>
196238

197-
### Related tables
198-
239+
<details>
240+
<summary>Related tables</summary>
241+
<br>
199242
``` graphql
200243
query {
201244
allPeople(filter: {
@@ -215,16 +258,19 @@ query {
215258
}
216259
}
217260
```
261+
</details>
218262

219263
For additional examples, see the [tests](https://github.com/mattbretl/postgraphile-plugin-connection-filter/blob/master/__tests__/fixtures/queries/connections-filter.graphql).
220264

221265
## Plugin Options
222266

223267
When using PostGraphile as a library, the following plugin options can be passed via `graphileBuildOptions`:
224268

225-
### connectionFilterAllowedOperators
269+
<details>
270+
<summary>connectionFilterAllowedOperators</summary>
271+
<br>
272+
Restrict filtering to specific operators:
226273

227-
Restrict filtering to specific operators
228274
``` js
229275
postgraphile(pgConfig, schema, {
230276
graphileBuildOptions: {
@@ -246,10 +292,13 @@ postgraphile(pgConfig, schema, {
246292
```
247293

248294
For a full list of the available operators, see the Comparison Operators table above.
295+
</details>
249296

250-
### connectionFilterAllowedFieldTypes
297+
<details>
298+
<summary>connectionFilterAllowedFieldTypes</summary>
299+
<br>
300+
Restrict filtering to specific field types:
251301

252-
Restrict filtering to specific field types
253302
``` js
254303
postgraphile(pgConfig, schema, {
255304
graphileBuildOptions: {
@@ -259,21 +308,27 @@ postgraphile(pgConfig, schema, {
259308
```
260309

261310
The available field types will depend on your database schema.
311+
</details>
262312

263-
### connectionFilterComputedColumns
313+
<details>
314+
<summary>connectionFilterComputedColumns</summary>
315+
<br>
316+
Enable/disable filtering by computed columns:
264317

265-
Enable/disable filtering by computed columns
266318
``` js
267319
postgraphile(pgConfig, schema, {
268320
graphileBuildOptions: {
269321
connectionFilterComputedColumns: false, // default: true
270322
},
271323
})
272324
```
325+
</details>
273326

274-
### connectionFilterOperatorNames
327+
<details>
328+
<summary>connectionFilterOperatorNames</summary>
329+
<br>
330+
Use alternative names (e.g. `eq`, `ne`) for operators:
275331

276-
Use alternative names (e.g. `eq`, `ne`) for operators
277332
``` js
278333
postgraphile(pgConfig, schema, {
279334
graphileBuildOptions: {
@@ -284,6 +339,7 @@ postgraphile(pgConfig, schema, {
284339
},
285340
})
286341
```
342+
</details>
287343

288344
## Development
289345

0 commit comments

Comments
 (0)