File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -475,10 +475,7 @@ describe('middlewares/batch', () => {
475475
476476 const rnl = new RelayNetworkLayer ( [
477477 batchMiddleware ( {
478- allowOperation : ( op ) => {
479- console . log ( 'op' , op ) ;
480- return ! [ 'abc' , 'def' ] . includes ( op . query ) ;
481- } ,
478+ allowOperation : ( op ) => ! [ 'abc' , 'def' ] . includes ( op . text ) ,
482479 } ) ,
483480 ] ) ;
484481 await Promise . all ( [
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { isFunction } from '../utils';
55import RelayRequestBatch from '../RelayRequestBatch' ;
66import RelayRequest from '../RelayRequest' ;
77import type RelayResponse from '../RelayResponse' ;
8- import type { Middleware , FetchOpts } from '../definition' ;
8+ import type { Middleware , FetchOpts , ConcreteBatch } from '../definition' ;
99import RRNLError from '../RRNLError' ;
1010
1111// Max out at roughly 100kb (express-graphql imposed max)
@@ -22,6 +22,7 @@ export type BatchMiddlewareOpts = {|
2222 maxBatchSize ? : number ,
2323 maxRequestsPerBatch ? : number ,
2424 allowMutations ? : boolean ,
25+ allowOperation ?: ( operation : ConcreteBatch ) => boolean ,
2526 method ?: 'POST' | 'GET' ,
2627 headers ?: Headers | Promise < Headers > | ( ( req : RelayRequestBatch ) => Headers | Promise < Headers > ) ,
2728 // Avaliable request modes in fetch options. For details see https://fetch.spec.whatwg.org/#requests
You can’t perform that action at this time.
0 commit comments