@@ -6,15 +6,18 @@ import { send as sendPostmaster } from '@constructive-io/postmaster';
66import { send as sendSmtp } from 'simple-smtp-server' ;
77import { parseEnvBoolean } from '@pgpmjs/env' ;
88
9- // Use plural connections with `condition` filter rather than singular-by-PK
10- // (`user(id:)`, `database(id:)`). The constructive server's preset extends
11- // NoUniqueLookupPreset, which deliberately disables singular root-field
12- // lookups by unique constraint (including primary key) to keep the API
13- // surface small. The plural+condition form is the supported way to fetch
14- // a row by id.
9+ // Use plural connections with the `where` filter (graphile-connection-filter)
10+ // rather than `condition:` or singular-by-PK. The constructive server's
11+ // ConstructivePreset:
12+ // 1. Extends NoUniqueLookupPreset — disables singular root-field lookups
13+ // by unique constraint, including primary key (`database(id:)`,
14+ // `user(id:)`).
15+ // 2. Disables `PgConditionArgumentPlugin` — removes the built-in
16+ // `condition:` argument on connections.
17+ // The supported pattern is `where: { field: { equalTo: var } }`.
1518const GetUser = gql `
1619 query GetUser($userId: UUID!) {
17- users(condition : { id: $userId }, first: 1) {
20+ users(where : { id: { equalTo: $userId } }, first: 1) {
1821 nodes {
1922 username
2023 displayName
@@ -26,7 +29,7 @@ const GetUser = gql`
2629
2730const GetDatabaseInfo = gql `
2831 query GetDatabaseInfo($databaseId: UUID!) {
29- databases(condition : { id: $databaseId }, first: 1) {
32+ databases(where : { id: { equalTo: $databaseId } }, first: 1) {
3033 nodes {
3134 sites {
3235 nodes {
@@ -43,7 +46,7 @@ const GetDatabaseInfo = gql`
4346 theme
4447 }
4548 }
46- siteModules(condition : { name: "legal_terms_module" }) {
49+ siteModules(where : { name: { equalTo: "legal_terms_module" } }) {
4750 nodes {
4851 data
4952 }
0 commit comments