Commit 5fd6f50
committed
fix(send-email-link): use 'where' filter instead of 'condition'
The previous fix (#38) switched from singular-by-PK lookups to plural
connections with the built-in postgraphile `condition:` argument.
That works on a stock postgraphile server, but not on constructive:
ConstructivePreset (constructive/graphile/graphile-settings/src/presets/constructive-preset.ts)
explicitly disables PgConditionArgumentPlugin and PgConditionCustomFieldsPlugin,
replacing `condition:` with the more powerful `where:` filter
provided by graphile-connection-filter.
Calling the queries against a real constructive server returns:
Unknown argument "condition" on field "Query.databases".
Unknown argument "condition" on field "Site.siteModules".
status: 400
Switch all `condition:` arguments to the equivalent
`where: { field: { equalTo: value } }` form. This matches the
older in-monorepo implementation in
constructive/functions/send-email-link/src/index.ts on the
constructive repo, which has been running against this server
config in production.
This wasn't caught by the existing tests because the GraphQL
clients are mocked with jest.fn().mockResolvedValue(...). The
queries had never been validated against a real schema.1 parent 4acf8e3 commit 5fd6f50
1 file changed
Lines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | | - | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | | - | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
46 | | - | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
0 commit comments