如何正确设置流程以与 react-apollo 一起使用?

How to properly setup flow to work with react-apollo?

我知道在 apollo-client 中 merged 有一些初始流类型。

例如,如果我有这样的代码:

// @flow
import { ApolloClient, createNetworkInterface } from 'react-apollo';
import fetch from 'isomorphic-fetch';

let apolloClient = null;

// Polyfill fetch() on the server (used by apollo-client)
if (!process.browser) {
  global.fetch = fetch;
}

function create() {
  return new ApolloClient({
    ssrMode: !process.browser, // Disables forceFetch on the server (so queries are only run once)
    networkInterface: createNetworkInterface({
      uri: 'https://api.graph.cool/simple/v1/cixmkt2ul01q00122mksg82pn', // Server URL (must be absolute)
      opts: {
        // Additional fetch() options like `credentials` or `headers`
        credentials: 'same-origin',
      },
    }),
  });
}

在我的 lib def 的另一边,我有:

declare module 'react-apollo' {
  declare module.exports: any;
}

我应该在这里输入什么(示例会有所帮助)进行类型检查?

this篇详细文章开始。

对于其他试图让 Flow 与 React Apollo 一起工作的人:

Flow is no longer supported with React Apollo.

看到这个comment on GitHub