Skip to content

Commit

Permalink
Force cjs import of certain apollo deps
Browse files Browse the repository at this point in the history
  • Loading branch information
dac09 committed Jun 24, 2024
1 parent 02f9275 commit 360645c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/web/src/apollo/fragmentRegistry.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as apolloClient from '@apollo/client'
import type { UseFragmentResult } from '@apollo/client'
// @ts-expect-error Force import cjs module
import { createFragmentRegistry } from '@apollo/client/cache/cache.cjs'
import type { FragmentRegistryAPI } from '@apollo/client/cache/index.js'
import { createFragmentRegistry } from '@apollo/client/cache/index.js'
import { getFragmentDefinitions } from '@apollo/client/utilities/index.js'
// @ts-expect-error Force import cjs module
import { getFragmentDefinitions } from '@apollo/client/utilities/utilities.cjs'
import type { DocumentNode } from 'graphql'

export type FragmentIdentifier = string | number
Expand Down
3 changes: 2 additions & 1 deletion packages/web/src/apollo/useCache.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { ApolloCache, Reference, StoreObject } from '@apollo/client'
import type { NormalizedCacheObject } from '@apollo/client/cache/inmemory/types.js'
import type { ApolloQueryResult } from '@apollo/client/core'
import { useApolloClient } from '@apollo/client/react/hooks/useApolloClient.js'
// @ts-expect-error Force import cjs module
import { useApolloClient } from '@apollo/client/react/hooks/hooks.cjs'

type useCacheType = {
cache: ApolloCache<object>
Expand Down
3 changes: 2 additions & 1 deletion packages/web/src/components/cell/createSuspendingCell.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { Suspense } from 'react'

import type { OperationVariables, QueryReference } from '@apollo/client'
import { useApolloClient } from '@apollo/client/react/hooks/useApolloClient.js'
// @ts-expect-error Force import cjs module
import { useApolloClient } from '@apollo/client/react/hooks/hooks.cjs'

import { useBackgroundQuery, useReadQuery } from '../GraphQLHooksProvider.js'

Expand Down

0 comments on commit 360645c

Please sign in to comment.