Skip to content

Commit

Permalink
change an import in useQuery and useMutation that added an unnece…
Browse files Browse the repository at this point in the history
…ssary runtime dependency on @apollo/client/core (#10877)

* hooks: untangle imports from core

* changeset

* Update .changeset/short-feet-relax.md

Co-authored-by: Jerel Miller <[email protected]>

---------

Co-authored-by: Jerel Miller <[email protected]>
  • Loading branch information
phryneas and jerelmiller authored May 16, 2023
1 parent 3009579 commit f402485
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-feet-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@apollo/client': patch
---

Change an import in `useQuery` and `useMutation` that added an unnecessary runtime dependency on `@apollo/client/core`. This drastically reduces the bundle size of each the hooks.
2 changes: 1 addition & 1 deletion src/react/hooks/useMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
OperationVariables} from '../../core';
import {
mergeOptions
} from '../../core';
} from '../../utilities';
import { equal } from '@wry/equality';
import { DocumentType, verifyDocumentType } from '../parser';
import { ApolloError } from '../../errors';
Expand Down
2 changes: 1 addition & 1 deletion src/react/hooks/useQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useSyncExternalStore } from './useSyncExternalStore';
import { equal } from '@wry/equality';

import type { OperationVariables, WatchQueryFetchPolicy } from '../../core';
import { mergeOptions } from '../../core';
import { mergeOptions } from '../../utilities';
import type { ApolloContextValue} from '../context';
import { getApolloContext } from '../context';
import { ApolloError } from '../../errors';
Expand Down

0 comments on commit f402485

Please sign in to comment.