Skip to content

Commit e2e397f

Browse files
committed
fix "edge" cases
1 parent db9df27 commit e2e397f

File tree

5 files changed

+282
-169
lines changed

5 files changed

+282
-169
lines changed

src/execution/__tests__/defer-test.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ describe('Execute: defer directive', () => {
480480
]);
481481
});
482482

483-
it('Does not (yet) separately emit defer fragments with different labels with varying subfields', async () => {
483+
it('Separately emits defer fragments with different labels with varying subfields', async () => {
484484
const document = parse(`
485485
query HeroNameQuery {
486486
hero {
@@ -516,7 +516,6 @@ describe('Execute: defer directive', () => {
516516
data: {
517517
hero: {
518518
id: '1',
519-
name: 'Luke',
520519
},
521520
},
522521
path: [],
@@ -525,7 +524,6 @@ describe('Execute: defer directive', () => {
525524
{
526525
data: {
527526
hero: {
528-
id: '1',
529527
name: 'Luke',
530528
},
531529
},
@@ -538,7 +536,7 @@ describe('Execute: defer directive', () => {
538536
]);
539537
});
540538

541-
it('Does not (yet) separately emit defer fragments with varying subfields of same priorities but different level of defers', async () => {
539+
it('Separately emits defer fragments with varying subfields of same priorities but different level of defers', async () => {
542540
const document = parse(`
543541
query HeroNameQuery {
544542
hero {
@@ -580,7 +578,6 @@ describe('Execute: defer directive', () => {
580578
{
581579
data: {
582580
hero: {
583-
id: '1',
584581
name: 'Luke',
585582
},
586583
},
@@ -593,7 +590,7 @@ describe('Execute: defer directive', () => {
593590
]);
594591
});
595592

596-
it('Does not (yet) separately emit nested defer fragments with varying subfields of same priorities but different level of defers', async () => {
593+
it('Separately emits nested defer fragments with varying subfields of same priorities but different level of defers', async () => {
597594
const document = parse(`
598595
query HeroNameQuery {
599596
hero {
@@ -633,7 +630,6 @@ describe('Execute: defer directive', () => {
633630
{
634631
data: {
635632
hero: {
636-
id: '1',
637633
name: 'Luke',
638634
},
639635
},

src/execution/__tests__/executor-test.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,12 @@ describe('Execute: Handles basic execution tasks', () => {
239239
const field = operation.selectionSet.selections[0];
240240
expect(resolvedInfo).to.deep.include({
241241
fieldNodes: [field],
242-
path: { prev: undefined, key: 'result', typename: 'Test' },
242+
path: {
243+
prev: undefined,
244+
key: 'result',
245+
typename: 'Test',
246+
fieldName: 'test',
247+
},
243248
variableValues: { var: 'abc' },
244249
});
245250
});
@@ -291,12 +296,15 @@ describe('Execute: Handles basic execution tasks', () => {
291296
expect(path).to.deep.equal({
292297
key: 'l2',
293298
typename: 'SomeObject',
299+
fieldName: 'test',
294300
prev: {
295301
key: 0,
296302
typename: undefined,
303+
fieldName: undefined,
297304
prev: {
298305
key: 'l1',
299306
typename: 'SomeQuery',
307+
fieldName: 'test',
300308
prev: undefined,
301309
},
302310
},

0 commit comments

Comments
 (0)