diff --git a/src/RelayRequest.ts b/src/RelayRequest.ts index 70d79e1..cff22d8 100644 --- a/src/RelayRequest.ts +++ b/src/RelayRequest.ts @@ -108,7 +108,6 @@ export default class RelayRequest { } clone(): RelayRequest { - // $FlowFixMe const newRequest = Object.assign(Object.create(Object.getPrototypeOf(this)), this); newRequest.fetchOpts = { ...this.fetchOpts }; @@ -117,4 +116,4 @@ export default class RelayRequest { return (newRequest as any); } -} \ No newline at end of file +} diff --git a/src/RelayRequestBatch.ts b/src/RelayRequestBatch.ts index e85e6c6..bd518f0 100644 --- a/src/RelayRequestBatch.ts +++ b/src/RelayRequestBatch.ts @@ -55,7 +55,6 @@ export default class RelayRequestBatch { } clone(): RelayRequestBatch { - // $FlowFixMe const newRequest = Object.assign(Object.create(Object.getPrototypeOf(this)), this); newRequest.fetchOpts = { ...this.fetchOpts }; @@ -72,4 +71,4 @@ export default class RelayRequestBatch { return this.prepareBody(); } -} \ No newline at end of file +} diff --git a/src/RelayResponse.ts b/src/RelayResponse.ts index 968a84a..ff8a30b 100644 --- a/src/RelayResponse.ts +++ b/src/RelayResponse.ts @@ -52,7 +52,6 @@ export default class RelayResponse { } clone(): RelayResponse { - // $FlowFixMe return Object.assign(Object.create(Object.getPrototypeOf(this)), this); } @@ -60,4 +59,4 @@ export default class RelayResponse { return [`Response:`, ` Url: ${this.url || ''}`, ` Status code: ${this.status || ''}`, ` Status text: ${this.statusText || ''}`, ` Response headers: ${JSON.stringify(this.headers) || ''}`, ` Response body: ${JSON.stringify(this.json) || ''}`].join('\n'); } -} \ No newline at end of file +} diff --git a/src/fetchWithMiddleware.ts b/src/fetchWithMiddleware.ts index b9f536a..1eafa08 100644 --- a/src/fetchWithMiddleware.ts +++ b/src/fetchWithMiddleware.ts @@ -32,7 +32,6 @@ const convertResponse: (next: MiddlewareRawNextFn) => MiddlewareNextFn = next => export default function fetchWithMiddleware(req: RelayRequestAny, middlewares: Middleware[], // works with RelayResponse rawFetchMiddlewares: MiddlewareRaw[], // works with raw fetch response noThrow?: boolean): Promise { - // $FlowFixMe const wrappedFetch: MiddlewareNextFn = compose(...middlewares, convertResponse, ...rawFetchMiddlewares)((runFetch as any)); return wrappedFetch(req).then(res => { if (!noThrow && (!res || res.errors || !res.data)) { @@ -59,7 +58,6 @@ function compose(...funcs) { } else { const last = funcs[funcs.length - 1]; const rest = funcs.slice(0, -1); - // $FlowFixMe - Suppress error about promise not being callable return (...args) => rest.reduceRight((composed, f) => f((composed as any)), last(...args)); } -} \ No newline at end of file +} diff --git a/src/middlewares/auth.ts b/src/middlewares/auth.ts index b8bfc7a..b4fa51a 100644 --- a/src/middlewares/auth.ts +++ b/src/middlewares/auth.ts @@ -28,7 +28,6 @@ export default function authMiddleware(opts?: AuthMiddlewareOpts): Middleware { let tokenRefreshInProgress = null; return next => async req => { try { - // $FlowFixMe const token = await (isFunction(tokenOrThunk) ? tokenOrThunk(req) : tokenOrThunk); if (!token && tokenRefreshPromise && !allowEmptyToken) { @@ -77,4 +76,4 @@ export default function authMiddleware(opts?: AuthMiddlewareOpts): Middleware { throw e; } }; -} \ No newline at end of file +} diff --git a/src/middlewares/batch.ts b/src/middlewares/batch.ts index 4452521..22b5879 100644 --- a/src/middlewares/batch.ts +++ b/src/middlewares/batch.ts @@ -176,7 +176,6 @@ async function sendRequests(requestList: RequestWrapper[], next, opts) { } else if (requestList.length > 1) { // SEND AS BATCHED QUERY const batchRequest = new RelayRequestBatch(requestList.map(wrapper => wrapper.req)); - // $FlowFixMe const url = await (isFunction(opts.batchUrl) ? opts.batchUrl(requestList) : opts.batchUrl); batchRequest.setFetchOption('url', url); const { @@ -235,4 +234,4 @@ function createSingleResponse(batchResponse: RelayResponse, json: any): RelayRes const res = batchResponse.clone(); res.processJsonData(data); return res; -} \ No newline at end of file +} diff --git a/src/middlewares/legacyBatch.ts b/src/middlewares/legacyBatch.ts index 6cb8c0a..71d7526 100644 --- a/src/middlewares/legacyBatch.ts +++ b/src/middlewares/legacyBatch.ts @@ -161,7 +161,6 @@ async function sendRequests(requestMap: BatchRequestMap, next, opts) { } else if (ids.length > 1) { // SEND AS BATCHED QUERY const batchRequest = new RelayRequestBatch(ids.map(id => requestMap[id].req)); - // $FlowFixMe const url = await (isFunction(opts.batchUrl) ? opts.batchUrl(requestMap) : opts.batchUrl); batchRequest.setFetchOption('url', url); const { @@ -219,4 +218,4 @@ function createSingleResponse(batchResponse: RelayResponse, json: any): RelayRes const res = batchResponse.clone(); res.processJsonData(data); return res; -} \ No newline at end of file +}