From 764b1b0a5d4b85af6ebd3c28d9d4d9f441059d6b Mon Sep 17 00:00:00 2001 From: hwillson Date: Wed, 9 Oct 2019 14:12:57 -0400 Subject: [PATCH] Remove the `ApolloClient` default export AC 2 exports `ApolloClient` as both the default and a named export. Since people will likely be using more exports from the `@apollo/client` package in AC 3 (e.g. integrated React hooks, Apollo Link's, etc.), let's kill the default export and only support the named export moving forward. --- CHANGELOG.md | 3 +++ package-lock.json | 16 ++++++++-------- src/ApolloClient.ts | 2 +- src/__tests__/ApolloClient.ts | 2 +- src/__tests__/client.ts | 4 ++-- src/__tests__/fetchMore.ts | 2 +- src/__tests__/graphqlSubscriptions.ts | 2 +- src/__tests__/local-state/export.ts | 2 +- src/__tests__/local-state/general.ts | 2 +- src/__tests__/local-state/resolvers.ts | 2 +- src/__tests__/local-state/subscriptions.ts | 2 +- src/__tests__/mutationResults.ts | 2 +- src/__tests__/optimistic.ts | 2 +- src/__tests__/subscribeToMore.ts | 2 +- src/core/LocalState.ts | 2 +- src/core/__tests__/ObservableQuery.ts | 2 +- src/core/__tests__/fetchPolicies.ts | 2 +- src/index.ts | 16 ++++++---------- src/react/context/ApolloConsumer.tsx | 2 +- src/react/context/ApolloContext.ts | 2 +- src/react/context/ApolloProvider.tsx | 2 +- .../context/__tests__/ApolloConsumer.test.tsx | 2 +- .../context/__tests__/ApolloProvider.test.tsx | 2 +- src/react/data/OperationData.ts | 2 +- .../hooks/__tests__/useApolloClient.test.tsx | 2 +- src/react/hooks/__tests__/useLazyQuery.test.tsx | 2 +- src/react/hooks/__tests__/useMutation.test.tsx | 2 +- src/react/hooks/__tests__/useQuery.test.tsx | 2 +- .../hooks/__tests__/useSubscription.test.tsx | 2 +- src/react/hooks/useApolloClient.ts | 2 +- src/react/testing/mocks/MockedProvider.tsx | 2 +- src/react/testing/mocks/types.ts | 2 +- src/react/testing/utils/createClient.ts | 2 +- src/react/types/types.ts | 2 +- 34 files changed, 49 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a9362e735a..aa6d8e6332b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,9 @@ - `QueryManager#startQuery` - `ObservableQuery#currentResult` +- `ApolloClient` is now only available as a named export. The default + `ApolloClient` export has been removed. + ## Apollo Client (2.6.4) ### Apollo Client (2.6.4) diff --git a/package-lock.json b/package-lock.json index 86b72616159..e0e52de8d99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@apollo/client", - "version": "3.0.0-alpha.6", + "version": "3.0.0-alpha.7", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3093,7 +3093,7 @@ }, "debug": { "version": "4.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "optional": true, @@ -3290,14 +3290,14 @@ }, "ms": { "version": "2.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true, "optional": true }, "needle": { "version": "2.3.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.0.tgz", "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "dev": true, "optional": true, @@ -3309,7 +3309,7 @@ }, "node-pre-gyp": { "version": "0.12.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz", "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", "dev": true, "optional": true, @@ -3339,14 +3339,14 @@ }, "npm-bundled": { "version": "1.0.6", - "resolved": false, + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.4.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz", "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "dev": true, "optional": true, @@ -3502,7 +3502,7 @@ }, "semver": { "version": "5.7.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true, "optional": true diff --git a/src/ApolloClient.ts b/src/ApolloClient.ts index ee6dc79658a..a8e4197e2de 100644 --- a/src/ApolloClient.ts +++ b/src/ApolloClient.ts @@ -61,7 +61,7 @@ export type ApolloClientOptions = { * receive results from the server and cache the results in a store. It also delivers updates * to GraphQL queries through {@link Observable} instances. */ -export default class ApolloClient implements DataProxy { +export class ApolloClient implements DataProxy { public link: ApolloLink; public store: DataStore; public cache: ApolloCache; diff --git a/src/__tests__/ApolloClient.ts b/src/__tests__/ApolloClient.ts index 34db3f60b5d..ca61dd25c5e 100644 --- a/src/__tests__/ApolloClient.ts +++ b/src/__tests__/ApolloClient.ts @@ -6,7 +6,7 @@ import { HttpLink } from '../link/http'; import { InMemoryCache, makeReference } from '../cache/inmemory'; import { stripSymbols } from '../utilities'; import { withWarning } from '../util/wrap'; -import ApolloClient from '../'; +import { ApolloClient } from '../'; import { DefaultOptions } from '../ApolloClient'; import { FetchPolicy, QueryOptions } from '../core/watchQueryOptions'; diff --git a/src/__tests__/client.ts b/src/__tests__/client.ts index 7f3f2067bec..1c850151269 100644 --- a/src/__tests__/client.ts +++ b/src/__tests__/client.ts @@ -8,7 +8,7 @@ import { InMemoryCache, PossibleTypesMap } from '../cache/inmemory'; import { stripSymbols } from '../utilities'; import { WatchQueryOptions, FetchPolicy } from '../core/watchQueryOptions'; import { ApolloError } from '../errors/ApolloError'; -import ApolloClient from '..'; +import { ApolloClient } from '..'; import subscribeAndCount from '../util/subscribeAndCount'; import { withWarning } from '../util/wrap'; import { mockSingleLink } from '../__mocks__/mockLinks'; @@ -16,7 +16,7 @@ import { mockSingleLink } from '../__mocks__/mockLinks'; describe('client', () => { it('can be loaded via require', () => { /* tslint:disable */ - const ApolloClientRequire = require('../').default; + const ApolloClientRequire = require('../').ApolloClient; /* tslint:enable */ const client = new ApolloClientRequire({ diff --git a/src/__tests__/fetchMore.ts b/src/__tests__/fetchMore.ts index ac561b1e351..7a0198321c1 100644 --- a/src/__tests__/fetchMore.ts +++ b/src/__tests__/fetchMore.ts @@ -3,7 +3,7 @@ import gql from 'graphql-tag'; import { mockSingleLink } from '../__mocks__/mockLinks'; import { InMemoryCache } from '../cache/inmemory'; -import ApolloClient, { NetworkStatus, ObservableQuery } from '../'; +import { ApolloClient, NetworkStatus, ObservableQuery } from '../'; describe('updateQuery on a simple query', () => { const query = gql` diff --git a/src/__tests__/graphqlSubscriptions.ts b/src/__tests__/graphqlSubscriptions.ts index 9e6d6a8e684..a07cfd8fd55 100644 --- a/src/__tests__/graphqlSubscriptions.ts +++ b/src/__tests__/graphqlSubscriptions.ts @@ -2,7 +2,7 @@ import gql from 'graphql-tag'; import { mockObservableLink, MockedSubscription } from '../__mocks__/mockLinks'; import { InMemoryCache } from '../cache/inmemory'; -import ApolloClient from '../'; +import { ApolloClient } from '../'; import { QueryManager } from '../core/QueryManager'; import { DataStore } from '../data/store'; diff --git a/src/__tests__/local-state/export.ts b/src/__tests__/local-state/export.ts index 3ac26031a3a..80edce5cdf9 100644 --- a/src/__tests__/local-state/export.ts +++ b/src/__tests__/local-state/export.ts @@ -3,7 +3,7 @@ import { print } from 'graphql/language/printer'; import { Observable } from '../../util/Observable'; import { ApolloLink } from '../../link/core'; -import ApolloClient from '../..'; +import { ApolloClient } from '../..'; import { InMemoryCache } from '../../cache/inmemory'; describe('@client @export tests', () => { diff --git a/src/__tests__/local-state/general.ts b/src/__tests__/local-state/general.ts index 0479dc46f78..9e081a23364 100644 --- a/src/__tests__/local-state/general.ts +++ b/src/__tests__/local-state/general.ts @@ -4,7 +4,7 @@ import { introspectionQuery } from 'graphql/utilities'; import { Observable } from '../../util/Observable'; import { ApolloLink, Operation } from '../../link/core'; -import ApolloClient from '../..'; +import { ApolloClient } from '../..'; import { ApolloCache } from '../../cache/core'; import { InMemoryCache } from '../../cache/inmemory'; import { hasDirectives } from '../../utilities'; diff --git a/src/__tests__/local-state/resolvers.ts b/src/__tests__/local-state/resolvers.ts index 85d0a84ade3..921d44cd06c 100644 --- a/src/__tests__/local-state/resolvers.ts +++ b/src/__tests__/local-state/resolvers.ts @@ -4,7 +4,7 @@ import { assign } from 'lodash'; import { Observable } from '../../util/Observable'; import { ApolloLink } from '../../link/core'; -import ApolloClient from '../..'; +import { ApolloClient } from '../..'; import mockQueryManager from '../../__mocks__/mockQueryManager'; import { Observer } from '../../util/Observable'; import wrap from '../../util/wrap'; diff --git a/src/__tests__/local-state/subscriptions.ts b/src/__tests__/local-state/subscriptions.ts index b13c9982928..59b10b3d4fa 100644 --- a/src/__tests__/local-state/subscriptions.ts +++ b/src/__tests__/local-state/subscriptions.ts @@ -2,7 +2,7 @@ import gql from 'graphql-tag'; import { Observable } from '../../util/Observable'; import { ApolloLink } from '../../link/core'; -import ApolloClient from '../..'; +import { ApolloClient } from '../..'; import { InMemoryCache } from '../../cache/inmemory'; describe('Basic functionality', () => { diff --git a/src/__tests__/mutationResults.ts b/src/__tests__/mutationResults.ts index f41ec01f68a..fd443263232 100644 --- a/src/__tests__/mutationResults.ts +++ b/src/__tests__/mutationResults.ts @@ -4,7 +4,7 @@ import gql from 'graphql-tag'; import { Observable } from '../util/Observable'; import { ApolloLink } from '../link/core'; import { mockSingleLink } from '../__mocks__/mockLinks'; -import ApolloClient from '..'; +import { ApolloClient } from '..'; import { InMemoryCache } from '../cache/inmemory'; import { Subscription } from '../util/Observable'; import { withWarning } from '../util/wrap'; diff --git a/src/__tests__/optimistic.ts b/src/__tests__/optimistic.ts index dc0966f02a3..1ea3be3c1c7 100644 --- a/src/__tests__/optimistic.ts +++ b/src/__tests__/optimistic.ts @@ -6,7 +6,7 @@ import gql from 'graphql-tag'; import { mockSingleLink } from '../__mocks__/mockLinks'; import { MutationQueryReducersMap } from '../core/types'; import { Subscription } from '../util/Observable'; -import ApolloClient from '../'; +import { ApolloClient } from '../'; import { addTypenameToDocument, stripSymbols } from '../utilities'; import { InMemoryCache, makeReference } from '../cache/inmemory'; diff --git a/src/__tests__/subscribeToMore.ts b/src/__tests__/subscribeToMore.ts index 74a61fd5f1e..e495bfdd6fc 100644 --- a/src/__tests__/subscribeToMore.ts +++ b/src/__tests__/subscribeToMore.ts @@ -3,7 +3,7 @@ import { DocumentNode, OperationDefinitionNode } from 'graphql'; import { ApolloLink, Operation } from '../link/core'; import { mockSingleLink, mockObservableLink } from '../__mocks__/mockLinks'; -import ApolloClient from '../'; +import { ApolloClient } from '../'; import { InMemoryCache } from '../cache/inmemory'; import { stripSymbols } from '../utilities'; diff --git a/src/core/LocalState.ts b/src/core/LocalState.ts index 29d3f4599fc..167100b637a 100644 --- a/src/core/LocalState.ts +++ b/src/core/LocalState.ts @@ -29,7 +29,7 @@ import { isField, isInlineFragment, } from '../utilities'; -import ApolloClient from '../ApolloClient'; +import { ApolloClient } from '../ApolloClient'; import { Resolvers, OperationVariables } from './types'; import { capitalizeFirstLetter } from '../util/capitalizeFirstLetter'; diff --git a/src/core/__tests__/ObservableQuery.ts b/src/core/__tests__/ObservableQuery.ts index f466b8ac6c2..153c1095605 100644 --- a/src/core/__tests__/ObservableQuery.ts +++ b/src/core/__tests__/ObservableQuery.ts @@ -12,7 +12,7 @@ import { ObservableQuery } from '../ObservableQuery'; import { NetworkStatus } from '../networkStatus'; import { QueryManager } from '../QueryManager'; import { DataStore } from '../../data/store'; -import ApolloClient from '../../'; +import { ApolloClient } from '../../'; import wrap from '../../util/wrap'; import subscribeAndCount from '../../util/subscribeAndCount'; diff --git a/src/core/__tests__/fetchPolicies.ts b/src/core/__tests__/fetchPolicies.ts index dcd77a2ac51..673c89104a5 100644 --- a/src/core/__tests__/fetchPolicies.ts +++ b/src/core/__tests__/fetchPolicies.ts @@ -3,7 +3,7 @@ import gql from 'graphql-tag'; import { ApolloLink } from '../../link/core'; import { InMemoryCache } from '../../cache/inmemory'; import { stripSymbols } from '../../utilities'; -import ApolloClient from '../..'; +import { ApolloClient } from '../..'; import subscribeAndCount from '../../util/subscribeAndCount'; import { mockSingleLink } from '../../__mocks__/mockLinks'; import { NetworkStatus } from '../networkStatus'; diff --git a/src/index.ts b/src/index.ts index 6934d778aa8..0ce6258eea3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,9 @@ +export { + ApolloClient, + ApolloClientOptions, + DefaultOptions +} from './ApolloClient'; + export { ObservableQuery, FetchMoreOptions, @@ -30,16 +36,6 @@ export { export { isApolloError, ApolloError } from './errors/ApolloError'; -import ApolloClient, { - ApolloClientOptions, - DefaultOptions, -} from './ApolloClient'; -export { ApolloClientOptions, DefaultOptions }; - -// Export the client as both default and named. -export { ApolloClient }; -export default ApolloClient; - export * from './cache/core'; export * from './cache/inmemory'; diff --git a/src/react/context/ApolloConsumer.tsx b/src/react/context/ApolloConsumer.tsx index 2e8a2ac4efa..8c5c1d7f1fe 100644 --- a/src/react/context/ApolloConsumer.tsx +++ b/src/react/context/ApolloConsumer.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { invariant } from 'ts-invariant'; -import ApolloClient from '../../ApolloClient'; +import { ApolloClient } from '../../ApolloClient'; import { getApolloContext } from './ApolloContext'; export interface ApolloConsumerProps { diff --git a/src/react/context/ApolloContext.ts b/src/react/context/ApolloContext.ts index e80c6299004..d96c98e5485 100644 --- a/src/react/context/ApolloContext.ts +++ b/src/react/context/ApolloContext.ts @@ -1,6 +1,6 @@ import React from 'react'; -import ApolloClient from '../../ApolloClient'; +import { ApolloClient } from '../../ApolloClient'; export interface ApolloContextValue { client?: ApolloClient; diff --git a/src/react/context/ApolloProvider.tsx b/src/react/context/ApolloProvider.tsx index 1bb98962e6d..89faef86320 100644 --- a/src/react/context/ApolloProvider.tsx +++ b/src/react/context/ApolloProvider.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { invariant } from 'ts-invariant'; -import ApolloClient from '../../ApolloClient'; +import { ApolloClient } from '../../ApolloClient'; import { getApolloContext } from './ApolloContext'; export interface ApolloProviderProps { diff --git a/src/react/context/__tests__/ApolloConsumer.test.tsx b/src/react/context/__tests__/ApolloConsumer.test.tsx index dc0a6875ae9..a7511cc34e2 100644 --- a/src/react/context/__tests__/ApolloConsumer.test.tsx +++ b/src/react/context/__tests__/ApolloConsumer.test.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { render, cleanup } from '@testing-library/react'; import { ApolloLink } from '../../../link/core'; -import ApolloClient from '../../../ApolloClient'; +import { ApolloClient } from '../../../ApolloClient'; import { InMemoryCache as Cache } from '../../../cache/inmemory/inMemoryCache'; import { ApolloProvider } from '../ApolloProvider'; import { ApolloConsumer } from '../ApolloConsumer'; diff --git a/src/react/context/__tests__/ApolloProvider.test.tsx b/src/react/context/__tests__/ApolloProvider.test.tsx index c16ad4780fa..a3fee0ab80e 100644 --- a/src/react/context/__tests__/ApolloProvider.test.tsx +++ b/src/react/context/__tests__/ApolloProvider.test.tsx @@ -2,7 +2,7 @@ import React, { useContext } from 'react'; import { render, cleanup } from '@testing-library/react'; import { ApolloLink } from '../../../link/core'; -import ApolloClient from '../../../ApolloClient'; +import { ApolloClient } from '../../../ApolloClient'; import { InMemoryCache as Cache } from '../../../cache/inmemory/inMemoryCache'; import { ApolloProvider } from '../ApolloProvider'; import { getApolloContext } from '../ApolloContext'; diff --git a/src/react/data/OperationData.ts b/src/react/data/OperationData.ts index 6abc32c51d7..234f1b09b7b 100644 --- a/src/react/data/OperationData.ts +++ b/src/react/data/OperationData.ts @@ -2,7 +2,7 @@ import { DocumentNode } from 'graphql'; import { equal as isEqual } from '@wry/equality'; import { invariant } from 'ts-invariant'; -import ApolloClient from '../../ApolloClient'; +import { ApolloClient } from '../../ApolloClient'; import { DocumentType, parser, operationName } from '../parser/parser'; import { ApolloContextValue } from '../context/ApolloContext'; import { CommonOptions } from '../types/types'; diff --git a/src/react/hooks/__tests__/useApolloClient.test.tsx b/src/react/hooks/__tests__/useApolloClient.test.tsx index 65a5e13921a..b663babdba5 100644 --- a/src/react/hooks/__tests__/useApolloClient.test.tsx +++ b/src/react/hooks/__tests__/useApolloClient.test.tsx @@ -5,7 +5,7 @@ import { InvariantError } from 'ts-invariant'; import { ApolloLink } from '../../../link/core'; import { ApolloProvider } from '../../context/ApolloProvider'; import { resetApolloContext } from '../../context/ApolloContext'; -import ApolloClient from '../../../ApolloClient'; +import { ApolloClient } from '../../../ApolloClient'; import { InMemoryCache } from '../../../cache/inmemory/inMemoryCache'; import { useApolloClient } from '../useApolloClient'; diff --git a/src/react/hooks/__tests__/useLazyQuery.test.tsx b/src/react/hooks/__tests__/useLazyQuery.test.tsx index 4a3ad872f02..91732e7a01c 100644 --- a/src/react/hooks/__tests__/useLazyQuery.test.tsx +++ b/src/react/hooks/__tests__/useLazyQuery.test.tsx @@ -4,7 +4,7 @@ import gql from 'graphql-tag'; import { render, wait } from '@testing-library/react'; import { MockedProvider } from '../../testing'; -import ApolloClient from '../../../ApolloClient'; +import { ApolloClient } from '../../../ApolloClient'; import { InMemoryCache } from '../../../cache/inmemory/inMemoryCache'; import { ApolloProvider } from '../../context/ApolloProvider'; import { useLazyQuery } from '../useLazyQuery'; diff --git a/src/react/hooks/__tests__/useMutation.test.tsx b/src/react/hooks/__tests__/useMutation.test.tsx index 080065346ec..92517a3a6a8 100644 --- a/src/react/hooks/__tests__/useMutation.test.tsx +++ b/src/react/hooks/__tests__/useMutation.test.tsx @@ -4,7 +4,7 @@ import gql from 'graphql-tag'; import { render, cleanup, wait } from '@testing-library/react'; import { MockedProvider, mockSingleLink } from '../../testing'; -import ApolloClient from '../../../ApolloClient'; +import { ApolloClient } from '../../../ApolloClient'; import { InMemoryCache } from '../../../cache/inmemory/inMemoryCache'; import { ApolloProvider } from '../../context/ApolloProvider'; import { useMutation } from '../useMutation'; diff --git a/src/react/hooks/__tests__/useQuery.test.tsx b/src/react/hooks/__tests__/useQuery.test.tsx index e7906957761..b594c1b7e67 100644 --- a/src/react/hooks/__tests__/useQuery.test.tsx +++ b/src/react/hooks/__tests__/useQuery.test.tsx @@ -6,7 +6,7 @@ import { render, cleanup, wait } from '@testing-library/react'; import { Observable } from '../../../util/Observable'; import { ApolloLink } from '../../../link/core'; import { MockedProvider, MockLink } from '../../testing'; -import ApolloClient from '../../../ApolloClient'; +import { ApolloClient } from '../../../ApolloClient'; import { InMemoryCache } from '../../../cache/inmemory/inMemoryCache'; import { ApolloProvider } from '../../context/ApolloProvider'; import { useQuery } from '../useQuery'; diff --git a/src/react/hooks/__tests__/useSubscription.test.tsx b/src/react/hooks/__tests__/useSubscription.test.tsx index ccb642ed458..b74735339f4 100644 --- a/src/react/hooks/__tests__/useSubscription.test.tsx +++ b/src/react/hooks/__tests__/useSubscription.test.tsx @@ -3,7 +3,7 @@ import { render, cleanup, wait } from '@testing-library/react'; import gql from 'graphql-tag'; import { MockSubscriptionLink } from '../../testing'; -import ApolloClient from '../../../ApolloClient'; +import { ApolloClient } from '../../../ApolloClient'; import { InMemoryCache as Cache } from '../../../cache/inmemory/inMemoryCache'; import { ApolloProvider } from '../../context/ApolloProvider'; import { useSubscription } from '../useSubscription'; diff --git a/src/react/hooks/useApolloClient.ts b/src/react/hooks/useApolloClient.ts index 1d8788b5377..c7b4deb4d3d 100644 --- a/src/react/hooks/useApolloClient.ts +++ b/src/react/hooks/useApolloClient.ts @@ -1,7 +1,7 @@ import React from 'react'; import { invariant } from 'ts-invariant'; -import ApolloClient from '../../ApolloClient'; +import { ApolloClient } from '../../ApolloClient'; import { getApolloContext } from '../context/ApolloContext'; export function useApolloClient(): ApolloClient { diff --git a/src/react/testing/mocks/MockedProvider.tsx b/src/react/testing/mocks/MockedProvider.tsx index 9d585f03806..1f216f894b7 100644 --- a/src/react/testing/mocks/MockedProvider.tsx +++ b/src/react/testing/mocks/MockedProvider.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import ApolloClient from '../../../ApolloClient'; +import { ApolloClient } from '../../../ApolloClient'; import { InMemoryCache as Cache } from '../../../cache/inmemory/inMemoryCache'; import { ApolloProvider } from '../../context/ApolloProvider'; import { MockLink } from './mockLink'; diff --git a/src/react/testing/mocks/types.ts b/src/react/testing/mocks/types.ts index f32e312ea22..585b8554f4f 100644 --- a/src/react/testing/mocks/types.ts +++ b/src/react/testing/mocks/types.ts @@ -1,5 +1,5 @@ import { ApolloLink, GraphQLRequest, FetchResult } from '../../../link/core'; -import ApolloClient, { DefaultOptions } from '../../../ApolloClient'; +import { ApolloClient, DefaultOptions } from '../../../ApolloClient'; import { Resolvers } from '../../../core/types'; import { ApolloCache } from '../../../cache/core/cache'; diff --git a/src/react/testing/utils/createClient.ts b/src/react/testing/utils/createClient.ts index 045e2b9f35b..d70fd11bb53 100644 --- a/src/react/testing/utils/createClient.ts +++ b/src/react/testing/utils/createClient.ts @@ -1,6 +1,6 @@ import { DocumentNode } from 'graphql'; -import ApolloClient from '../../../ApolloClient'; +import { ApolloClient } from '../../../ApolloClient'; import { InMemoryCache } from '../../../cache/inmemory/inMemoryCache'; import { NormalizedCacheObject } from '../../../cache/inmemory/types'; import { mockSingleLink } from '../mocks/mockLink'; diff --git a/src/react/types/types.ts b/src/react/types/types.ts index 056fd3c7a6e..799b9d490c8 100644 --- a/src/react/types/types.ts +++ b/src/react/types/types.ts @@ -3,7 +3,7 @@ import { DocumentNode } from 'graphql'; import { Observable } from '../../util/Observable'; import { FetchResult } from '../../link/core'; -import ApolloClient from '../../ApolloClient'; +import { ApolloClient } from '../../ApolloClient'; import { ApolloQueryResult, PureQueryOptions,