Skip to content

Flowtype failing on my repo #64

Description

@golmansax

Hi, I believe 84b3361#diff-98bf0f0a5018817161c912b3742e1b02R17 should make credentials an optional property in Flow.

See the following Flow error I'm getting in my repo. Happy to submit a pull request if you agree with this change.

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/react-relay-network-layer/lib/middleware/batch.js.flow:162:46

Cannot assign object literal to req because property credentials is missing in object literal [1] but exists in
FetchOpts [2].

     node_modules/react-relay-network-layer/lib/middleware/batch.js.flow
     159│     // $FlowFixMe
     160│     const url = isFunction(opts.batchUrl) ? opts.batchUrl(requestMap) : opts.batchUrl;
     161│
 [1] 162│     const req: RRNLRequestObjectBatchQuery = {
     163│       url,
     164│       relayReqId: `BATCH_QUERY:${ids.join(':')}`,
     165│       relayReqMap: requestMap,
     166│       relayReqType: 'batch-query',
     167│       method: 'POST',
     168│       headers: {
     169│         Accept: '*/*',
     170│         'Content-Type': 'application/json',
     171│       },
     172│       body: `[${ids.map(id => requestMap[id].req.body).join(',')}]`,
     173│     };
     174│
     175│     return next(req)
     176│       .then(batchResponse => {

     node_modules/react-relay-network-layer/lib/definition.js.flow
 [2]  37│ export type RRNLRequestObjectBatchQuery = FetchOpts & {

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions