Commit 3105b22
committed
fix(send-email-link): use plural connections with condition filter
The GetUser and GetDatabaseInfo queries used singular root fields
`user(id:)` and `database(id:)`. These are not exposed by the
constructive server: ConstructivePreset extends NoUniqueLookupPreset
(see constructive/graphile/graphile-settings/src/plugins/primary-key-only.ts),
which deliberately disables singular root-field lookups by unique
constraint — including primary key — to keep the API surface small.
Calling these queries against a real constructive server returns:
Cannot query field "database" on type "Query".
Did you mean "databases" or "tables"?
Switch to the plural-connection-with-condition form, matching the
older in-monorepo implementation (see
constructive/functions/send-email-link/src/index.ts on the constructive
repo). Update the destructure paths to walk through .nodes[0]
accordingly.
This wasn't caught by the existing tests because
functions/send-email-link/__tests__/handler.graphql.test.ts contains
only it.todo placeholders, and the validation tests in handler.test.ts
mock the meta/client clients with jest.fn().mockResolvedValue(). The
queries had never actually been run against a real constructive server.
Surfaced by constructive-hub PR #137, which is the first integration
running this fn-runtime against a fully-deployed constructive stack.1 parent 9fb9705 commit 3105b22
1 file changed
Lines changed: 33 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
15 | 23 | | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
28 | 38 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
35 | 45 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
40 | 50 | | |
41 | 51 | | |
42 | 52 | | |
| |||
111 | 121 | | |
112 | 122 | | |
113 | 123 | | |
114 | | - | |
| 124 | + | |
115 | 125 | | |
116 | 126 | | |
117 | 127 | | |
| |||
177 | 187 | | |
178 | 188 | | |
179 | 189 | | |
180 | | - | |
| 190 | + | |
181 | 191 | | |
182 | 192 | | |
183 | 193 | | |
| |||
0 commit comments