@@ -54,7 +54,8 @@ describe('execute diagnostics channel', () => {
5454 const executeChannel = getTracingChannel ( 'graphql:execute' ) ;
5555
5656 it ( 'emits start and end around a synchronous execute' , async ( ) => {
57- const document = parse ( 'query Q { sync }' ) ;
57+ const document = parse ( 'query Q($sync: String) { sync }' ) ;
58+ const variableValues = { sync : 'ignored by the field' } ;
5859
5960 await expectEvents (
6061 executeChannel ,
@@ -63,14 +64,15 @@ describe('execute diagnostics channel', () => {
6364 schema,
6465 document,
6566 rootValue : { sync : ( ) => 'hello' } ,
67+ variableValues,
6668 } ) ,
6769 ( result ) => [
6870 {
6971 channel : 'start' ,
7072 context : {
7173 document,
7274 schema,
73- variableValues : undefined ,
75+ variableValues,
7476 operationName : 'Q' ,
7577 operationType : 'query' ,
7678 } ,
@@ -80,7 +82,7 @@ describe('execute diagnostics channel', () => {
8082 context : {
8183 document,
8284 schema,
83- variableValues : undefined ,
85+ variableValues,
8486 operationName : 'Q' ,
8587 operationType : 'query' ,
8688 result,
@@ -370,9 +372,9 @@ describe('execute diagnostics channel', () => {
370372 yield { tick : 'two' } ;
371373 }
372374
373- const document = parse ( 'subscription S { tick }' ) ;
375+ const document = parse ( 'subscription S($tick: String) { tick }' ) ;
374376 const operation = document . definitions [ 0 ] ;
375- const variableValues = { coerced : { } , sources : { } } ;
377+ const variableValues = { tick : 'ignored by the field' } ;
376378
377379 await expectEvents (
378380 executeChannel ,
@@ -381,6 +383,7 @@ describe('execute diagnostics channel', () => {
381383 schema,
382384 document,
383385 rootValue : { tick : tickGenerator } ,
386+ variableValues,
384387 } ) ;
385388 assert ( isAsyncIterable ( subscription ) ) ;
386389
@@ -470,7 +473,8 @@ describe('subscribe diagnostics channel', () => {
470473 }
471474
472475 it ( 'emits start and end for a synchronous subscription setup' , async ( ) => {
473- const document = parse ( 'subscription S { tick }' ) ;
476+ const document = parse ( 'subscription S($tick: String) { tick }' ) ;
477+ const variableValues = { tick : 'ignored by the field' } ;
474478
475479 await expectEvents (
476480 subscribeChannel ,
@@ -479,6 +483,7 @@ describe('subscribe diagnostics channel', () => {
479483 schema,
480484 document,
481485 rootValue : { tick : twoTicks } ,
486+ variableValues,
482487 } ) ;
483488 assert ( isAsyncIterable ( subscription ) ) ;
484489
@@ -494,7 +499,7 @@ describe('subscribe diagnostics channel', () => {
494499 context : {
495500 document,
496501 schema,
497- variableValues : undefined ,
502+ variableValues,
498503 operationName : 'S' ,
499504 operationType : 'subscription' ,
500505 } ,
@@ -504,7 +509,7 @@ describe('subscribe diagnostics channel', () => {
504509 context : {
505510 document,
506511 schema,
507- variableValues : undefined ,
512+ variableValues,
508513 operationName : 'S' ,
509514 operationType : 'subscription' ,
510515 result,
0 commit comments