Skip to content

Commit

Permalink
chore: separate type imports in useSuspenseQuery.ts, useBackgroundQue…
Browse files Browse the repository at this point in the history
…ry.ts and useReadQuery.ts (#11134)
  • Loading branch information
alessbell authored Aug 28, 2023
1 parent 3570147 commit 96492e1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/fifty-suits-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

Use separate type imports in useSuspenseQuery and useBackgroundQuery to workaround SWC compiler issue.
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
"message": "Please only use the namespace import syntax (`import * as React from 'react'`) for React imports!"
}
],
"import/consistent-type-specifier-style": [
"error",
"prefer-top-level"
],
"import/extensions": [
"error",
"always",
Expand Down
3 changes: 2 additions & 1 deletion src/react/hooks/useBackgroundQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import type {
TypedDocumentNode,
} from "../../core/index.js";
import { useApolloClient } from "./useApolloClient.js";
import { wrapQueryRef, type QueryReference } from "../cache/QueryReference.js";
import { wrapQueryRef } from "../cache/QueryReference.js";
import type { QueryReference } from "../cache/QueryReference.js";
import type { BackgroundQueryHookOptions, NoInfer } from "../types/types.js";
import { __use } from "./internal/index.js";
import { getSuspenseCache } from "../cache/index.js";
Expand Down
6 changes: 2 additions & 4 deletions src/react/hooks/useReadQuery.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as React from "react";
import {
unwrapQueryRef,
type QueryReference,
} from "../cache/QueryReference.js";
import { unwrapQueryRef } from "../cache/QueryReference.js";
import type { QueryReference } from "../cache/QueryReference.js";
import { __use } from "./internal/index.js";
import { toApolloError } from "./useSuspenseQuery.js";
import { invariant } from "../../utilities/globals/index.js";
Expand Down
3 changes: 2 additions & 1 deletion src/react/hooks/useSuspenseQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import type {
import { __use, useDeepMemo } from "./internal/index.js";
import { getSuspenseCache } from "../cache/index.js";
import { canonicalStringify } from "../../cache/index.js";
import { skipToken, type SkipToken } from "./constants.js";
import { skipToken } from "./constants.js";
import type { SkipToken } from "./constants.js";
import type { CacheKey } from "../cache/types.js";

export interface UseSuspenseQueryResult<
Expand Down

0 comments on commit 96492e1

Please sign in to comment.