Skip to content

Commit 70d6ba9

Browse files
committed
Fix test once again + missing attribute.
1 parent 14e0dcd commit 70d6ba9

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/middlewares/__tests__/batch-test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff 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([

src/middlewares/batch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { isFunction } from '../utils';
55
import RelayRequestBatch from '../RelayRequestBatch';
66
import RelayRequest from '../RelayRequest';
77
import type RelayResponse from '../RelayResponse';
8-
import type { Middleware, FetchOpts } from '../definition';
8+
import type { Middleware, FetchOpts, ConcreteBatch } from '../definition';
99
import 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

0 commit comments

Comments
 (0)