File tree Expand file tree Collapse file tree 2 files changed +521
-0
lines changed Expand file tree Collapse file tree 2 files changed +521
-0
lines changed Original file line number Diff line number Diff line change 1+ begin;
2+ create table account(
3+ id int primary key
4+ );
5+ create table address(
6+ id int primary key,
7+ account_id int not null references account(id)
8+ );
9+ select jsonb_pretty(
10+ graphql.resolve($$
11+ {
12+ __type(name: "Account") {
13+ kind
14+ fields {
15+ name
16+ type {
17+ name
18+ kind
19+ ofType { name }
20+ }
21+ }
22+ }
23+ }
24+ $$)
25+ );
26+ jsonb_pretty
27+ ------------------------------------------------------
28+ { +
29+ "data": { +
30+ "__type": { +
31+ "kind": "OBJECT", +
32+ "fields": [ +
33+ { +
34+ "name": "nodeId", +
35+ "type": { +
36+ "kind": "NON_NULL", +
37+ "name": null, +
38+ "ofType": { +
39+ "name": "ID" +
40+ } +
41+ } +
42+ }, +
43+ { +
44+ "name": "id", +
45+ "type": { +
46+ "kind": "NON_NULL", +
47+ "name": null, +
48+ "ofType": { +
49+ "name": "Int" +
50+ } +
51+ } +
52+ }, +
53+ { +
54+ "name": "addressCollection", +
55+ "type": { +
56+ "kind": "OBJECT", +
57+ "name": "AddressConnection",+
58+ "ofType": null +
59+ } +
60+ } +
61+ ] +
62+ } +
63+ } +
64+ }
65+ (1 row)
66+
67+ select jsonb_pretty(
68+ graphql.resolve($$
69+ {
70+ __type(name: "Address") {
71+ kind
72+ fields {
73+ name
74+ type {
75+ name
76+ kind
77+ ofType { name }
78+ }
79+ }
80+ }
81+ }
82+ $$)
83+ );
84+ jsonb_pretty
85+ -----------------------------------------------
86+ { +
87+ "data": { +
88+ "__type": { +
89+ "kind": "OBJECT", +
90+ "fields": [ +
91+ { +
92+ "name": "nodeId", +
93+ "type": { +
94+ "kind": "NON_NULL", +
95+ "name": null, +
96+ "ofType": { +
97+ "name": "ID" +
98+ } +
99+ } +
100+ }, +
101+ { +
102+ "name": "id", +
103+ "type": { +
104+ "kind": "NON_NULL", +
105+ "name": null, +
106+ "ofType": { +
107+ "name": "Int" +
108+ } +
109+ } +
110+ }, +
111+ { +
112+ "name": "accountId", +
113+ "type": { +
114+ "kind": "NON_NULL", +
115+ "name": null, +
116+ "ofType": { +
117+ "name": "Int" +
118+ } +
119+ } +
120+ }, +
121+ { +
122+ "name": "account", +
123+ "type": { +
124+ "kind": "NON_NULL", +
125+ "name": null, +
126+ "ofType": { +
127+ "name": "Account"+
128+ } +
129+ } +
130+ } +
131+ ] +
132+ } +
133+ } +
134+ }
135+ (1 row)
136+
137+ alter table account enable row level security;
138+ select jsonb_pretty(
139+ graphql.resolve($$
140+ {
141+ __type(name: "Account") {
142+ kind
143+ fields {
144+ name
145+ type {
146+ name
147+ kind
148+ ofType { name }
149+ }
150+ }
151+ }
152+ }
153+ $$)
154+ );
155+ jsonb_pretty
156+ ------------------------------------------------------
157+ { +
158+ "data": { +
159+ "__type": { +
160+ "kind": "OBJECT", +
161+ "fields": [ +
162+ { +
163+ "name": "nodeId", +
164+ "type": { +
165+ "kind": "NON_NULL", +
166+ "name": null, +
167+ "ofType": { +
168+ "name": "ID" +
169+ } +
170+ } +
171+ }, +
172+ { +
173+ "name": "id", +
174+ "type": { +
175+ "kind": "NON_NULL", +
176+ "name": null, +
177+ "ofType": { +
178+ "name": "Int" +
179+ } +
180+ } +
181+ }, +
182+ { +
183+ "name": "addressCollection", +
184+ "type": { +
185+ "kind": "OBJECT", +
186+ "name": "AddressConnection",+
187+ "ofType": null +
188+ } +
189+ } +
190+ ] +
191+ } +
192+ } +
193+ }
194+ (1 row)
195+
196+ select jsonb_pretty(
197+ graphql.resolve($$
198+ {
199+ __type(name: "Address") {
200+ kind
201+ fields {
202+ name
203+ type {
204+ name
205+ kind
206+ ofType { name }
207+ }
208+ }
209+ }
210+ }
211+ $$)
212+ );
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+ } +
263+ }
264+ (1 row)
265+
266+ alter table account disable row level security;
267+ alter table address enable row level security;
268+ select jsonb_pretty(
269+ graphql.resolve($$
270+ {
271+ __type(name: "Account") {
272+ kind
273+ fields {
274+ name
275+ type {
276+ name
277+ kind
278+ ofType { name }
279+ }
280+ }
281+ }
282+ }
283+ $$)
284+ );
285+ jsonb_pretty
286+ ------------------------------------------------------
287+ { +
288+ "data": { +
289+ "__type": { +
290+ "kind": "OBJECT", +
291+ "fields": [ +
292+ { +
293+ "name": "nodeId", +
294+ "type": { +
295+ "kind": "NON_NULL", +
296+ "name": null, +
297+ "ofType": { +
298+ "name": "ID" +
299+ } +
300+ } +
301+ }, +
302+ { +
303+ "name": "id", +
304+ "type": { +
305+ "kind": "NON_NULL", +
306+ "name": null, +
307+ "ofType": { +
308+ "name": "Int" +
309+ } +
310+ } +
311+ }, +
312+ { +
313+ "name": "addressCollection", +
314+ "type": { +
315+ "kind": "OBJECT", +
316+ "name": "AddressConnection",+
317+ "ofType": null +
318+ } +
319+ } +
320+ ] +
321+ } +
322+ } +
323+ }
324+ (1 row)
325+
326+ select jsonb_pretty(
327+ graphql.resolve($$
328+ {
329+ __type(name: "Address") {
330+ kind
331+ fields {
332+ name
333+ type {
334+ name
335+ kind
336+ ofType { name }
337+ }
338+ }
339+ }
340+ }
341+ $$)
342+ );
343+ jsonb_pretty
344+ -----------------------------------------------
345+ { +
346+ "data": { +
347+ "__type": { +
348+ "kind": "OBJECT", +
349+ "fields": [ +
350+ { +
351+ "name": "nodeId", +
352+ "type": { +
353+ "kind": "NON_NULL", +
354+ "name": null, +
355+ "ofType": { +
356+ "name": "ID" +
357+ } +
358+ } +
359+ }, +
360+ { +
361+ "name": "id", +
362+ "type": { +
363+ "kind": "NON_NULL", +
364+ "name": null, +
365+ "ofType": { +
366+ "name": "Int" +
367+ } +
368+ } +
369+ }, +
370+ { +
371+ "name": "accountId", +
372+ "type": { +
373+ "kind": "NON_NULL", +
374+ "name": null, +
375+ "ofType": { +
376+ "name": "Int" +
377+ } +
378+ } +
379+ }, +
380+ { +
381+ "name": "account", +
382+ "type": { +
383+ "kind": "NON_NULL", +
384+ "name": null, +
385+ "ofType": { +
386+ "name": "Account"+
387+ } +
388+ } +
389+ } +
390+ ] +
391+ } +
392+ } +
393+ }
394+ (1 row)
395+
396+ rollback;
You can’t perform that action at this time.
0 commit comments