title: Using ApolloClient with node.js. "fetch is not found globally and no fetcher passed"
body: <p>I am attempting to use an Apollo Client on a node.js server to interface with another GraphQL API using the following code:</p>
  
  <pre><code>import fetch from 'node-fetch'
  import { createHttpLink } from 'apollo-link-http'
  
  import ApolloClient from 'apollo-boost'
  import { API_URL } from '...'
  
  const client = new ApolloClient({
    link: createHttpLink({
      uri: API_URL,
      fetch: fetch,
    }),
  })
  </code></pre>
  
  <p>Which yields the following error:</p>
  
  <pre><code>module initialization error: Error
  fetch is not found globally and no fetcher passed, to fix pass a fetch for
  your environment like https://www.npmjs.com/package/node-fetch.
  
  For example:
  import fetch from 'node-fetch';
  import { createHttpLink } from 'apollo-link-http';
  
  const link = createHttpLink({ uri: '/graphql', fetch: fetch });
  at Object.checkFetcher (/var/task/node_modules/apollo-link-http-common/lib/bundle.umd.js:78:19)
  at createHttpLink (/var/task/node_modules/apollo-link-http/lib/bundle.umd.js:32:30)
  at new HttpLink (/var/task/node_modules/apollo-link-http/lib/bundle.umd.js:203:38)
  at new DefaultClient (/var/task/node_modules/apollo-boost/lib/index.js:80:24)
  </code></pre>
  
  <p>I understand that the Apollo Client by default is expecting to be run in a browser context where a <code>fetch</code> method will be available, and that in a node.js I need to polyfill or otherwise provide a <code>fetch</code> method, but I having trouble figuring out exactly how to do this.</p>
  
  <p>Following the example code at <a href="https://www.apollographql.com/docs/link/#apollo-client" rel="noreferrer">https://www.apollographql.com/docs/link/#apollo-client</a> it appears that I should be able to pass this information in using the <code>link</code> option, and reading the <code>apollo-boost</code> source code seems to suggest that you can pass this information in using <code>fetcherOptions</code>, but neither of these solutions seem to work.</p>
  
  <p>Can anyone provide some example code for initializing an Apollo Client in node.js with a fetcher?</p>
  
  <p>For reference here is my <code>package.json</code></p>
  
  <pre><code>{
    "name": "API-Service",
    "version": "1.0.0",
    "description": "",
    "private": true,
    "scripts": {},
    "dependencies": {
      "apollo-boost": "^0.1.6",
      "apollo-link-http": "^1.5.4",
      "graphql": "^0.13.2",
      "babel-polyfill": "^6.26.0",
      "json-rules-engine": "^2.1.0",
      "node-fetch": "^2.1.2",
      "mysql": "^2.15.0"
    }
  }
  </code></pre>