Skip to content

Commit

Permalink
Add extensions to ESM imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rubendinho committed Dec 18, 2024
1 parent b8bac6d commit a42f8a7
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/api/graphql/client.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -50,10 +50,10 @@ export class QuilttClient<T> extends ApolloClient<T> {
*/

/** 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'
4 changes: 2 additions & 2 deletions packages/core/src/api/graphql/links/ActionCableLink.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/api/graphql/links/AuthLink.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/api/graphql/links/BatchHttpLink.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/api/graphql/links/ErrorLink.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/api/graphql/links/ForwardableLink.ts
Original file line number Diff line number Diff line change
@@ -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))

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/api/graphql/links/HttpLink.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/api/graphql/links/RetryLink.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/api/graphql/links/TerminatingLink.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApolloLink } from '@apollo/client/core'
import { ApolloLink } from '@apollo/client/core/index.js'

export const TerminatingLink = new ApolloLink(() => null)

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/api/graphql/links/VersionLink.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApolloLink } from '@apollo/client/core'
import { ApolloLink } from '@apollo/client/core/index.js'

import { version } from '@/configuration'

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/hooks/useQuilttClient.ts
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/providers/QuilttAuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit a42f8a7

Please sign in to comment.