Skip to content

Commit 9d2258d

Browse files
committed
enabling RLS makes inbound relationships nullable
1 parent abb9b41 commit 9d2258d

File tree

2 files changed

+49
-50
lines changed

2 files changed

+49
-50
lines changed

src/graphql.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,6 +1958,7 @@ impl NodeType {
19581958
.columns
19591959
.iter()
19601960
.any(|c| &c.name == colname && c.is_not_null)
1961+
&& !fkey.referenced_table_meta.is_rls_enabled
19611962
}) {
19621963
__Type::NonNull(NonNullType {
19631964
type_: Box::new(type_),

test/expected/issue_409_fkey_rls_nullability.out

Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -210,56 +210,54 @@ begin;
210210
}
211211
$$)
212212
);
213-
jsonb_pretty
214-
-----------------------------------------------
215-
{ +
216-
"data": { +
217-
"__type": { +
218-
"kind": "OBJECT", +
219-
"fields": [ +
220-
{ +
221-
"name": "nodeId", +
222-
"type": { +
223-
"kind": "NON_NULL", +
224-
"name": null, +
225-
"ofType": { +
226-
"name": "ID" +
227-
} +
228-
} +
229-
}, +
230-
{ +
231-
"name": "id", +
232-
"type": { +
233-
"kind": "NON_NULL", +
234-
"name": null, +
235-
"ofType": { +
236-
"name": "Int" +
237-
} +
238-
} +
239-
}, +
240-
{ +
241-
"name": "accountId", +
242-
"type": { +
243-
"kind": "NON_NULL", +
244-
"name": null, +
245-
"ofType": { +
246-
"name": "Int" +
247-
} +
248-
} +
249-
}, +
250-
{ +
251-
"name": "account", +
252-
"type": { +
253-
"kind": "NON_NULL", +
254-
"name": null, +
255-
"ofType": { +
256-
"name": "Account"+
257-
} +
258-
} +
259-
} +
260-
] +
261-
} +
262-
} +
213+
jsonb_pretty
214+
---------------------------------------------
215+
{ +
216+
"data": { +
217+
"__type": { +
218+
"kind": "OBJECT", +
219+
"fields": [ +
220+
{ +
221+
"name": "nodeId", +
222+
"type": { +
223+
"kind": "NON_NULL",+
224+
"name": null, +
225+
"ofType": { +
226+
"name": "ID" +
227+
} +
228+
} +
229+
}, +
230+
{ +
231+
"name": "id", +
232+
"type": { +
233+
"kind": "NON_NULL",+
234+
"name": null, +
235+
"ofType": { +
236+
"name": "Int" +
237+
} +
238+
} +
239+
}, +
240+
{ +
241+
"name": "accountId", +
242+
"type": { +
243+
"kind": "NON_NULL",+
244+
"name": null, +
245+
"ofType": { +
246+
"name": "Int" +
247+
} +
248+
} +
249+
}, +
250+
{ +
251+
"name": "account", +
252+
"type": { +
253+
"kind": "OBJECT", +
254+
"name": "Account", +
255+
"ofType": null +
256+
} +
257+
} +
258+
] +
259+
} +
260+
} +
263261
}
264262
(1 row)
265263

0 commit comments

Comments
 (0)