From a42f8a7625527c073c3c54bc0e77a7e440f5b49f Mon Sep 17 00:00:00 2001 From: Ruben Izmailyan Date: Wed, 18 Dec 2024 02:36:50 -0600 Subject: [PATCH] Add extensions to ESM imports --- packages/core/src/api/graphql/client.ts | 8 ++++---- packages/core/src/api/graphql/links/ActionCableLink.ts | 4 ++-- packages/core/src/api/graphql/links/AuthLink.ts | 2 +- packages/core/src/api/graphql/links/BatchHttpLink.ts | 2 +- packages/core/src/api/graphql/links/ErrorLink.ts | 2 +- packages/core/src/api/graphql/links/ForwardableLink.ts | 2 +- packages/core/src/api/graphql/links/HttpLink.ts | 2 +- packages/core/src/api/graphql/links/RetryLink.ts | 2 +- packages/core/src/api/graphql/links/TerminatingLink.ts | 2 +- packages/core/src/api/graphql/links/VersionLink.ts | 2 +- packages/react/src/hooks/useQuilttClient.ts | 2 +- packages/react/src/providers/QuilttAuthProvider.tsx | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/core/src/api/graphql/client.ts b/packages/core/src/api/graphql/client.ts index dda8406c..d4ef7387 100644 --- a/packages/core/src/api/graphql/client.ts +++ b/packages/core/src/api/graphql/client.ts @@ -1,5 +1,5 @@ +import { ApolloClient, ApolloLink } from '@apollo/client/core/index.js' import type { ApolloClientOptions, Operation } from '@apollo/client/core' -import { ApolloClient, ApolloLink } from '@apollo/client/core' import { debugging } from '../../configuration' import { @@ -50,10 +50,10 @@ export class QuilttClient extends ApolloClient { */ /** Client and Tooling */ -export { gql } from '@apollo/client/core' -export { InMemoryCache } from '@apollo/client/cache' +export { gql } from '@apollo/client/core/index.js' +export { InMemoryCache } from '@apollo/client/cache/index.js' export type { ApolloError, OperationVariables } from '@apollo/client/core' export type { NormalizedCacheObject } from '@apollo/client/cache' /** React hooks used by @quiltt/react-native and @quiltt/react */ -export { useMutation, useQuery, useSubscription } from '@apollo/client/react/hooks' +export { useMutation, useQuery, useSubscription } from '@apollo/client/react/hooks/index.js' diff --git a/packages/core/src/api/graphql/links/ActionCableLink.ts b/packages/core/src/api/graphql/links/ActionCableLink.ts index 3f64a0dc..64cd10df 100644 --- a/packages/core/src/api/graphql/links/ActionCableLink.ts +++ b/packages/core/src/api/graphql/links/ActionCableLink.ts @@ -1,5 +1,5 @@ -import { ApolloLink } from '@apollo/client/core' -import { Observable } from '@apollo/client/utilities' +import { ApolloLink } from '@apollo/client/core/index.js' +import { Observable } from '@apollo/client/utilities/index.js' import type { FetchResult, NextLink, Operation } from '@apollo/client/core' import { createConsumer } from '@rails/actioncable' diff --git a/packages/core/src/api/graphql/links/AuthLink.ts b/packages/core/src/api/graphql/links/AuthLink.ts index a3217a5a..9f3ffc85 100644 --- a/packages/core/src/api/graphql/links/AuthLink.ts +++ b/packages/core/src/api/graphql/links/AuthLink.ts @@ -1,4 +1,4 @@ -import { ApolloLink } from '@apollo/client/core' +import { ApolloLink } from '@apollo/client/core/index.js' import type { FetchResult, NextLink, Operation } from '@apollo/client/core' import type { Observable } from '@apollo/client/utilities' diff --git a/packages/core/src/api/graphql/links/BatchHttpLink.ts b/packages/core/src/api/graphql/links/BatchHttpLink.ts index 02d28cdb..75adeb6b 100644 --- a/packages/core/src/api/graphql/links/BatchHttpLink.ts +++ b/packages/core/src/api/graphql/links/BatchHttpLink.ts @@ -1,4 +1,4 @@ -import { BatchHttpLink as ApolloHttpLink } from '@apollo/client/link/batch-http' +import { BatchHttpLink as ApolloHttpLink } from '@apollo/client/link/batch-http/index.js' import crossfetch from 'cross-fetch' import { endpointGraphQL } from '@/configuration' diff --git a/packages/core/src/api/graphql/links/ErrorLink.ts b/packages/core/src/api/graphql/links/ErrorLink.ts index 1fc2f954..c728351f 100644 --- a/packages/core/src/api/graphql/links/ErrorLink.ts +++ b/packages/core/src/api/graphql/links/ErrorLink.ts @@ -1,7 +1,7 @@ import { GlobalStorage } from '@/storage' +import { onError } from '@apollo/client/link/error/index.js' import type { ServerError } from '@apollo/client/core' -import { onError } from '@apollo/client/link/error' export const ErrorLink = onError(({ graphQLErrors, networkError }) => { if (graphQLErrors) { diff --git a/packages/core/src/api/graphql/links/ForwardableLink.ts b/packages/core/src/api/graphql/links/ForwardableLink.ts index f78e18b0..1ec0c2f7 100644 --- a/packages/core/src/api/graphql/links/ForwardableLink.ts +++ b/packages/core/src/api/graphql/links/ForwardableLink.ts @@ -1,4 +1,4 @@ -import { ApolloLink } from '@apollo/client/core' +import { ApolloLink } from '@apollo/client/core/index.js' export const ForwardableLink = new ApolloLink((operation, forward) => forward(operation)) diff --git a/packages/core/src/api/graphql/links/HttpLink.ts b/packages/core/src/api/graphql/links/HttpLink.ts index d20e1692..d6df2e87 100644 --- a/packages/core/src/api/graphql/links/HttpLink.ts +++ b/packages/core/src/api/graphql/links/HttpLink.ts @@ -1,4 +1,4 @@ -import { HttpLink as ApolloHttpLink } from '@apollo/client/link/http' +import { HttpLink as ApolloHttpLink } from '@apollo/client/link/http/index.js' import crossfetch from 'cross-fetch' // Use `cross-fetch` only if `fetch` is not available on the `globalThis` object diff --git a/packages/core/src/api/graphql/links/RetryLink.ts b/packages/core/src/api/graphql/links/RetryLink.ts index 3a349172..808ca986 100644 --- a/packages/core/src/api/graphql/links/RetryLink.ts +++ b/packages/core/src/api/graphql/links/RetryLink.ts @@ -1,4 +1,4 @@ -import { RetryLink as ApolloRetryLink } from '@apollo/client/link/retry' +import { RetryLink as ApolloRetryLink } from '@apollo/client/link/retry/index.js' export const RetryLink = new ApolloRetryLink({ attempts: { diff --git a/packages/core/src/api/graphql/links/TerminatingLink.ts b/packages/core/src/api/graphql/links/TerminatingLink.ts index c93e7711..4dc91944 100644 --- a/packages/core/src/api/graphql/links/TerminatingLink.ts +++ b/packages/core/src/api/graphql/links/TerminatingLink.ts @@ -1,4 +1,4 @@ -import { ApolloLink } from '@apollo/client/core' +import { ApolloLink } from '@apollo/client/core/index.js' export const TerminatingLink = new ApolloLink(() => null) diff --git a/packages/core/src/api/graphql/links/VersionLink.ts b/packages/core/src/api/graphql/links/VersionLink.ts index e27d7dac..36b42535 100644 --- a/packages/core/src/api/graphql/links/VersionLink.ts +++ b/packages/core/src/api/graphql/links/VersionLink.ts @@ -1,4 +1,4 @@ -import { ApolloLink } from '@apollo/client/core' +import { ApolloLink } from '@apollo/client/core/index.js' import { version } from '@/configuration' diff --git a/packages/react/src/hooks/useQuilttClient.ts b/packages/react/src/hooks/useQuilttClient.ts index 2f95f7f5..2097b1a6 100644 --- a/packages/react/src/hooks/useQuilttClient.ts +++ b/packages/react/src/hooks/useQuilttClient.ts @@ -1,6 +1,6 @@ 'use client' -import { useApolloClient } from '@apollo/client/react/hooks' +import { useApolloClient } from '@apollo/client/react/hooks/useApolloClient.js' export const useQuilttClient = useApolloClient diff --git a/packages/react/src/providers/QuilttAuthProvider.tsx b/packages/react/src/providers/QuilttAuthProvider.tsx index 77479ade..a5978855 100644 --- a/packages/react/src/providers/QuilttAuthProvider.tsx +++ b/packages/react/src/providers/QuilttAuthProvider.tsx @@ -3,7 +3,7 @@ import type { FC, PropsWithChildren } from 'react' import { useEffect, useMemo } from 'react' -import { ApolloProvider } from '@apollo/client/react' +import { ApolloProvider } from '@apollo/client/react/context/ApolloProvider.js' import { InMemoryCache, QuilttClient } from '@quiltt/core'