Skip to content

Commit 0313d3b

Browse files
committed
consolidate payloads
1 parent 2fbb293 commit 0313d3b

File tree

3 files changed

+42
-157
lines changed

3 files changed

+42
-157
lines changed

src/execution/__tests__/defer-test.ts

+20-64
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,6 @@ describe('Execute: defer directive', () => {
679679
hasNext: true,
680680
},
681681
{
682-
pending: [{ path: ['hero'], label: 'DeferID' }],
683682
incremental: [
684683
{
685684
data: {
@@ -689,20 +688,17 @@ describe('Execute: defer directive', () => {
689688
},
690689
path: [],
691690
},
692-
],
693-
completed: [{ path: [], label: 'DeferName' }],
694-
hasNext: true,
695-
},
696-
{
697-
incremental: [
698691
{
699692
data: {
700693
id: '1',
701694
},
702695
path: ['hero'],
703696
},
704697
],
705-
completed: [{ path: ['hero'], label: 'DeferID' }],
698+
completed: [
699+
{ path: [], label: 'DeferName' },
700+
{ path: ['hero'], label: 'DeferID' },
701+
],
706702
hasNext: false,
707703
},
708704
]);
@@ -870,7 +866,6 @@ describe('Execute: defer directive', () => {
870866
hasNext: true,
871867
},
872868
{
873-
pending: [{ path: ['hero', 'nestedObject', 'deeperObject'] }],
874869
incremental: [
875870
{
876871
data: {
@@ -880,20 +875,17 @@ describe('Execute: defer directive', () => {
880875
},
881876
path: ['hero'],
882877
},
883-
],
884-
completed: [{ path: ['hero'] }],
885-
hasNext: true,
886-
},
887-
{
888-
incremental: [
889878
{
890879
data: {
891880
bar: 'bar',
892881
},
893882
path: ['hero', 'nestedObject', 'deeperObject'],
894883
},
895884
],
896-
completed: [{ path: ['hero', 'nestedObject', 'deeperObject'] }],
885+
completed: [
886+
{ path: ['hero'] },
887+
{ path: ['hero', 'nestedObject', 'deeperObject'] },
888+
],
897889
hasNext: false,
898890
},
899891
]);
@@ -948,35 +940,25 @@ describe('Execute: defer directive', () => {
948940
hasNext: true,
949941
},
950942
{
951-
pending: [{ path: ['hero', 'nestedObject'] }],
952943
incremental: [
953944
{
954945
data: { bar: 'bar' },
955946
path: ['hero', 'nestedObject', 'deeperObject'],
956947
},
957-
],
958-
completed: [{ path: ['hero'] }],
959-
hasNext: true,
960-
},
961-
{
962-
pending: [{ path: ['hero', 'nestedObject', 'deeperObject'] }],
963-
incremental: [
964948
{
965949
data: { baz: 'baz' },
966950
path: ['hero', 'nestedObject', 'deeperObject'],
967951
},
968-
],
969-
hasNext: true,
970-
completed: [{ path: ['hero', 'nestedObject'] }],
971-
},
972-
{
973-
incremental: [
974952
{
975953
data: { bak: 'bak' },
976954
path: ['hero', 'nestedObject', 'deeperObject'],
977955
},
978956
],
979-
completed: [{ path: ['hero', 'nestedObject', 'deeperObject'] }],
957+
completed: [
958+
{ path: ['hero'] },
959+
{ path: ['hero', 'nestedObject'] },
960+
{ path: ['hero', 'nestedObject', 'deeperObject'] },
961+
],
980962
hasNext: false,
981963
},
982964
]);
@@ -1023,31 +1005,25 @@ describe('Execute: defer directive', () => {
10231005
hasNext: true,
10241006
},
10251007
{
1026-
pending: [{ path: ['hero', 'nestedObject', 'deeperObject'] }],
10271008
incremental: [
10281009
{
10291010
data: {
10301011
foo: 'foo',
10311012
},
10321013
path: ['hero', 'nestedObject', 'deeperObject'],
10331014
},
1034-
],
1035-
completed: [
1036-
{ path: ['hero'] },
1037-
{ path: ['hero', 'nestedObject', 'deeperObject'] },
1038-
],
1039-
hasNext: true,
1040-
},
1041-
{
1042-
incremental: [
10431015
{
10441016
data: {
10451017
bar: 'bar',
10461018
},
10471019
path: ['hero', 'nestedObject', 'deeperObject'],
10481020
},
10491021
],
1050-
completed: [{ path: ['hero', 'nestedObject', 'deeperObject'] }],
1022+
completed: [
1023+
{ path: ['hero'] },
1024+
{ path: ['hero', 'nestedObject', 'deeperObject'] },
1025+
{ path: ['hero', 'nestedObject', 'deeperObject'] },
1026+
],
10511027
hasNext: false,
10521028
},
10531029
]);
@@ -1843,27 +1819,17 @@ describe('Execute: defer directive', () => {
18431819
hasNext: true,
18441820
},
18451821
{
1846-
pending: [
1847-
{ path: ['hero', 'friends', 0] },
1848-
{ path: ['hero', 'friends', 1] },
1849-
{ path: ['hero', 'friends', 2] },
1850-
],
18511822
incremental: [
18521823
{
18531824
data: { name: 'slow', friends: [{}, {}, {}] },
18541825
path: ['hero'],
18551826
},
1856-
],
1857-
completed: [{ path: ['hero'] }],
1858-
hasNext: true,
1859-
},
1860-
{
1861-
incremental: [
18621827
{ data: { name: 'Han' }, path: ['hero', 'friends', 0] },
18631828
{ data: { name: 'Leia' }, path: ['hero', 'friends', 1] },
18641829
{ data: { name: 'C-3PO' }, path: ['hero', 'friends', 2] },
18651830
],
18661831
completed: [
1832+
{ path: ['hero'] },
18671833
{ path: ['hero', 'friends', 0] },
18681834
{ path: ['hero', 'friends', 1] },
18691835
{ path: ['hero', 'friends', 2] },
@@ -1900,11 +1866,6 @@ describe('Execute: defer directive', () => {
19001866
hasNext: true,
19011867
},
19021868
{
1903-
pending: [
1904-
{ path: ['hero', 'friends', 0] },
1905-
{ path: ['hero', 'friends', 1] },
1906-
{ path: ['hero', 'friends', 2] },
1907-
],
19081869
incremental: [
19091870
{
19101871
data: {
@@ -1913,17 +1874,12 @@ describe('Execute: defer directive', () => {
19131874
},
19141875
path: ['hero'],
19151876
},
1916-
],
1917-
completed: [{ path: ['hero'] }],
1918-
hasNext: true,
1919-
},
1920-
{
1921-
incremental: [
19221877
{ data: { name: 'Han' }, path: ['hero', 'friends', 0] },
19231878
{ data: { name: 'Leia' }, path: ['hero', 'friends', 1] },
19241879
{ data: { name: 'C-3PO' }, path: ['hero', 'friends', 2] },
19251880
],
19261881
completed: [
1882+
{ path: ['hero'] },
19271883
{ path: ['hero', 'friends', 0] },
19281884
{ path: ['hero', 'friends', 1] },
19291885
{ path: ['hero', 'friends', 2] },

0 commit comments

Comments
 (0)