Intended outcome:
Creating a client does not emit warnings or errors.
Actual outcome:
One of each is displayed in the console:
WARN: ApolloBoost was initialized with unsupported options: 0
ERR: Uncaught TypeError: Cannot set property 'defaultOptions' of undefined
How to reproduce the issue:
Follow the getting started docs from https://www.apollographql.com/docs/react/essentials/get-started/ in a Laravel Mix managed setup. Mix uses Webpack under the hood, and I've had no trouble getting React, Redux, Thunk, etc. to work so far.
import ApolloClient from 'apollo-boost';
const client = new ApolloClient({
uri: 'http://127.0.0.1/graphql'
});
I tried without the uri
option as well with the same result.
Versions
npx: installed 1 in 2.299s
System:
OS: Linux 4.15 Ubuntu 18.04.2 LTS (Bionic Beaver)
Binaries:
Node: 11.7.0 - ~/.nvm/versions/node/v11.7.0/bin/node
Yarn: 1.12.3 - /usr/bin/yarn
npm: 6.5.0 - ~/.nvm/versions/node/v11.7.0/bin/npm
Browsers:
Chrome: 74.0.3729.131
Firefox: 66.0.3
npmPackages:
apollo-boost: ^0.3.1 => 0.3.1
Looks like both are from using import gql ...
instead of import { gql } ...
.
Most helpful comment
Looks like both are from using
import gql ...
instead ofimport { gql } ...
.