Skip to content

Commit 1a7688b

Browse files
committed
add more tests
1 parent 7312565 commit 1a7688b

File tree

2 files changed

+114
-2
lines changed

2 files changed

+114
-2
lines changed

test/expected/issue_237_field_merging.out

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,72 @@ begin;
191191
}
192192
(1 row)
193193

194+
select jsonb_pretty(graphql.resolve($$ {
195+
accountCollection {
196+
edges {
197+
... on AccountEdge {
198+
cursor
199+
cursor
200+
node {
201+
id
202+
email
203+
}
204+
}
205+
... on AccountEdge {
206+
cursor
207+
cursor
208+
node {
209+
id
210+
email
211+
}
212+
}
213+
... cursorsFragment
214+
... anotherCursorsFragment
215+
cursor
216+
cursor
217+
node {
218+
id
219+
email
220+
}
221+
}
222+
}
223+
}
224+
fragment cursorsFragment on AccountEdge {
225+
cursor
226+
cursor
227+
node {
228+
id
229+
email
230+
}
231+
}
232+
fragment anotherCursorsFragment on AccountEdge {
233+
cursor
234+
cursor
235+
node {
236+
id
237+
email
238+
}
239+
}
240+
$$));
241+
jsonb_pretty
242+
---------------------------------------------------
243+
{ +
244+
"data": { +
245+
"accountCollection": { +
246+
"edges": [ +
247+
{ +
248+
"node": { +
249+
"id": 1, +
250+
"email": "aardvark@x.com"+
251+
}, +
252+
"cursor": "WzFd" +
253+
} +
254+
] +
255+
} +
256+
} +
257+
}
258+
(1 row)
259+
194260
select jsonb_pretty(graphql.resolve($$ {
195261
accountCollection {
196262
edges {
@@ -219,7 +285,6 @@ begin;
219285
}
220286
}
221287
}
222-
223288
$$));
224289
jsonb_pretty
225290
---------------------------------------------------

test/sql/issue_237_field_merging.sql

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,54 @@ begin;
124124
'count', 1
125125
)));
126126

127+
select jsonb_pretty(graphql.resolve($$ {
128+
accountCollection {
129+
edges {
130+
... on AccountEdge {
131+
cursor
132+
cursor
133+
node {
134+
id
135+
email
136+
}
137+
}
138+
... on AccountEdge {
139+
cursor
140+
cursor
141+
node {
142+
id
143+
email
144+
}
145+
}
146+
... cursorsFragment
147+
... anotherCursorsFragment
148+
cursor
149+
cursor
150+
node {
151+
id
152+
email
153+
}
154+
}
155+
}
156+
}
157+
fragment cursorsFragment on AccountEdge {
158+
cursor
159+
cursor
160+
node {
161+
id
162+
email
163+
}
164+
}
165+
fragment anotherCursorsFragment on AccountEdge {
166+
cursor
167+
cursor
168+
node {
169+
id
170+
email
171+
}
172+
}
173+
$$));
174+
127175
select jsonb_pretty(graphql.resolve($$ {
128176
accountCollection {
129177
edges {
@@ -152,7 +200,6 @@ begin;
152200
}
153201
}
154202
}
155-
156203
$$));
157204

158205
rollback;

0 commit comments

Comments
 (0)