diff --git a/apps/web/src/components/Common/Providers/index.tsx b/apps/web/src/components/Common/Providers/index.tsx index 1c068d4b9767..f0479a1cb929 100644 --- a/apps/web/src/components/Common/Providers/index.tsx +++ b/apps/web/src/components/Common/Providers/index.tsx @@ -1,5 +1,6 @@ +import { ApolloProvider } from "@apollo/client"; import authLink from "@helpers/authLink"; -import { ApolloProvider, apolloClient } from "@hey/lens/apollo"; +import apolloClient from "@hey/lens/apollo/client"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { ThemeProvider } from "next-themes"; import type { FC, ReactNode } from "react"; @@ -14,6 +15,7 @@ import ServiceWorkerProvider from "./ServiceWorkerProvider"; import Web3Provider from "./Web3Provider"; const lensApolloClient = apolloClient(authLink); + const queryClient = new QueryClient({ defaultOptions: { queries: { refetchOnWindowFocus: false } } }); diff --git a/apps/web/src/components/Publication/Actions/HigherActions/GardenerActions.tsx b/apps/web/src/components/Publication/Actions/HigherActions/GardenerActions.tsx index f2e0d7f6b9fa..ae99266107db 100644 --- a/apps/web/src/components/Publication/Actions/HigherActions/GardenerActions.tsx +++ b/apps/web/src/components/Publication/Actions/HigherActions/GardenerActions.tsx @@ -1,3 +1,4 @@ +import { useApolloClient } from "@apollo/client"; import { getAuthApiHeadersWithAccessToken } from "@helpers/getAuthApiHeaders"; import { Leafwatch } from "@helpers/leafwatch"; import { BanknotesIcon, DocumentTextIcon } from "@heroicons/react/24/outline"; @@ -6,7 +7,6 @@ import { GARDENER } from "@hey/data/tracking"; import stopEventPropagation from "@hey/helpers/stopEventPropagation"; import type { MirrorablePublication } from "@hey/lens"; import { PublicationReportingSpamSubreason } from "@hey/lens"; -import { useApolloClient } from "@hey/lens/apollo"; import { Button } from "@hey/ui"; import axios from "axios"; import { useRouter } from "next/router"; diff --git a/apps/web/src/components/Publication/Actions/Menu/Bookmark.tsx b/apps/web/src/components/Publication/Actions/Menu/Bookmark.tsx index e9a5fbb726ba..5ce804631424 100644 --- a/apps/web/src/components/Publication/Actions/Menu/Bookmark.tsx +++ b/apps/web/src/components/Publication/Actions/Menu/Bookmark.tsx @@ -1,3 +1,4 @@ +import type { ApolloCache } from "@apollo/client"; import { MenuItem } from "@headlessui/react"; import errorToast from "@helpers/errorToast"; import { Leafwatch } from "@helpers/leafwatch"; @@ -13,7 +14,6 @@ import { useAddPublicationBookmarkMutation, useRemovePublicationBookmarkMutation } from "@hey/lens"; -import type { ApolloCache } from "@hey/lens/apollo"; import cn from "@hey/ui/cn"; import { useCounter, useToggle } from "@uidotdev/usehooks"; import { useRouter } from "next/router"; diff --git a/apps/web/src/components/Publication/Actions/Menu/HideComment.tsx b/apps/web/src/components/Publication/Actions/Menu/HideComment.tsx index da2dd1096fcd..ca431dcbe4fb 100644 --- a/apps/web/src/components/Publication/Actions/Menu/HideComment.tsx +++ b/apps/web/src/components/Publication/Actions/Menu/HideComment.tsx @@ -1,3 +1,4 @@ +import type { ApolloCache } from "@apollo/client"; import { useHiddenCommentFeedStore } from "@components/Publication"; import { MenuItem } from "@headlessui/react"; import errorToast from "@helpers/errorToast"; @@ -11,7 +12,6 @@ import type { UnhideCommentRequest } from "@hey/lens"; import { useHideCommentMutation, useUnhideCommentMutation } from "@hey/lens"; -import type { ApolloCache } from "@hey/lens/apollo"; import cn from "@hey/ui/cn"; import type { FC } from "react"; import { toast } from "react-hot-toast"; diff --git a/apps/web/src/components/Publication/Actions/Menu/NotInterested.tsx b/apps/web/src/components/Publication/Actions/Menu/NotInterested.tsx index 7bf7f8b20b59..02e1e4d43c40 100644 --- a/apps/web/src/components/Publication/Actions/Menu/NotInterested.tsx +++ b/apps/web/src/components/Publication/Actions/Menu/NotInterested.tsx @@ -1,3 +1,4 @@ +import type { ApolloCache } from "@apollo/client"; import { MenuItem } from "@headlessui/react"; import errorToast from "@helpers/errorToast"; import { Leafwatch } from "@helpers/leafwatch"; @@ -12,7 +13,6 @@ import { useAddPublicationNotInterestedMutation, useUndoPublicationNotInterestedMutation } from "@hey/lens"; -import type { ApolloCache } from "@hey/lens/apollo"; import cn from "@hey/ui/cn"; import type { FC } from "react"; import { toast } from "react-hot-toast"; diff --git a/apps/web/src/components/Publication/Actions/Share/UndoMirror.tsx b/apps/web/src/components/Publication/Actions/Share/UndoMirror.tsx index ba39a6439c5d..4b1cf7921821 100644 --- a/apps/web/src/components/Publication/Actions/Share/UndoMirror.tsx +++ b/apps/web/src/components/Publication/Actions/Share/UndoMirror.tsx @@ -1,3 +1,4 @@ +import { useApolloClient } from "@apollo/client"; import { MenuItem } from "@headlessui/react"; import errorToast from "@helpers/errorToast"; import { Leafwatch } from "@helpers/leafwatch"; @@ -7,7 +8,6 @@ import { PUBLICATION } from "@hey/data/tracking"; import { isMirrorPublication } from "@hey/helpers/publicationHelpers"; import type { AnyPublication } from "@hey/lens"; import { useHidePublicationMutation } from "@hey/lens"; -import { useApolloClient } from "@hey/lens/apollo"; import cn from "@hey/ui/cn"; import type { Dispatch, FC, SetStateAction } from "react"; import { toast } from "react-hot-toast"; diff --git a/apps/web/src/components/Publication/QueuedPublication.tsx b/apps/web/src/components/Publication/QueuedPublication.tsx index 1052f698b3b4..fae72b92afad 100644 --- a/apps/web/src/components/Publication/QueuedPublication.tsx +++ b/apps/web/src/components/Publication/QueuedPublication.tsx @@ -1,3 +1,4 @@ +import { useApolloClient } from "@apollo/client"; import Markup from "@components/Shared/Markup"; import SmallSingleProfile from "@components/Shared/SmallSingleProfile"; import getMentions from "@hey/helpers/getMentions"; @@ -8,7 +9,6 @@ import { useLensTransactionStatusQuery, usePublicationLazyQuery } from "@hey/lens"; -import { useApolloClient } from "@hey/lens/apollo"; import type { OptimisticTransaction } from "@hey/types/misc"; import { Card, Tooltip } from "@hey/ui"; import type { FC } from "react"; diff --git a/apps/web/src/components/Settings/Interests/Interests.tsx b/apps/web/src/components/Settings/Interests/Interests.tsx index 54610408dc42..c8f8eccc7201 100644 --- a/apps/web/src/components/Settings/Interests/Interests.tsx +++ b/apps/web/src/components/Settings/Interests/Interests.tsx @@ -1,3 +1,4 @@ +import { useApolloClient } from "@apollo/client"; import Loader from "@components/Shared/Loader"; import errorToast from "@helpers/errorToast"; import { Leafwatch } from "@helpers/leafwatch"; @@ -12,7 +13,6 @@ import { useProfileInterestsOptionsQuery, useRemoveProfileInterestsMutation } from "@hey/lens"; -import { useApolloClient } from "@hey/lens/apollo"; import { Button } from "@hey/ui"; import type { FC } from "react"; import toast from "react-hot-toast"; diff --git a/apps/web/src/components/Settings/Manager/ProfileManager/Managers/List.tsx b/apps/web/src/components/Settings/Manager/ProfileManager/Managers/List.tsx index bddef85d76bf..f7f3eea59fe7 100644 --- a/apps/web/src/components/Settings/Manager/ProfileManager/Managers/List.tsx +++ b/apps/web/src/components/Settings/Manager/ProfileManager/Managers/List.tsx @@ -1,3 +1,4 @@ +import { useApolloClient } from "@apollo/client"; import LazyDefaultProfile from "@components/Shared/LazyDefaultProfile"; import Loader from "@components/Shared/Loader"; import errorToast from "@helpers/errorToast"; @@ -16,7 +17,6 @@ import { useCreateChangeProfileManagersTypedDataMutation, useProfileManagersQuery } from "@hey/lens"; -import { useApolloClient } from "@hey/lens/apollo"; import { Button, EmptyState, ErrorMessage } from "@hey/ui"; import type { FC } from "react"; import { useState } from "react"; diff --git a/apps/web/src/components/Shared/Alert/BlockOrUnBlockProfile.tsx b/apps/web/src/components/Shared/Alert/BlockOrUnBlockProfile.tsx index 54ad1d3ed46e..2e1e2e89d377 100644 --- a/apps/web/src/components/Shared/Alert/BlockOrUnBlockProfile.tsx +++ b/apps/web/src/components/Shared/Alert/BlockOrUnBlockProfile.tsx @@ -1,3 +1,4 @@ +import type { ApolloCache } from "@apollo/client"; import errorToast from "@helpers/errorToast"; import { Leafwatch } from "@helpers/leafwatch"; import { LensHub } from "@hey/abis"; @@ -15,7 +16,6 @@ import { useCreateUnblockProfilesTypedDataMutation, useUnblockMutation } from "@hey/lens"; -import type { ApolloCache } from "@hey/lens/apollo"; import { Alert } from "@hey/ui"; import type { FC } from "react"; import { useState } from "react"; diff --git a/apps/web/src/components/Shared/Profile/Follow.tsx b/apps/web/src/components/Shared/Profile/Follow.tsx index ca327178d850..3cd98471351f 100644 --- a/apps/web/src/components/Shared/Profile/Follow.tsx +++ b/apps/web/src/components/Shared/Profile/Follow.tsx @@ -1,3 +1,4 @@ +import { useApolloClient } from "@apollo/client"; import errorToast from "@helpers/errorToast"; import { Leafwatch } from "@helpers/leafwatch"; import { LensHub } from "@hey/abis"; @@ -12,7 +13,6 @@ import { useCreateFollowTypedDataMutation, useFollowMutation } from "@hey/lens"; -import { useApolloClient } from "@hey/lens/apollo"; import { OptmisticPublicationType } from "@hey/types/enums"; import type { OptimisticTransaction } from "@hey/types/misc"; import { Button } from "@hey/ui"; diff --git a/apps/web/src/components/Shared/Profile/SuperFollow/FollowModule.tsx b/apps/web/src/components/Shared/Profile/SuperFollow/FollowModule.tsx index 43d5c4ee4dbf..5f2da49a4020 100644 --- a/apps/web/src/components/Shared/Profile/SuperFollow/FollowModule.tsx +++ b/apps/web/src/components/Shared/Profile/SuperFollow/FollowModule.tsx @@ -1,3 +1,4 @@ +import { useApolloClient } from "@apollo/client"; import AllowanceButton from "@components/Settings/Allowance/Button"; import Loader from "@components/Shared/Loader"; import NoBalanceError from "@components/Shared/NoBalanceError"; @@ -26,7 +27,6 @@ import { useCreateFollowTypedDataMutation, useProfileQuery } from "@hey/lens"; -import { useApolloClient } from "@hey/lens/apollo"; import { Button, H3, H5, WarningMessage } from "@hey/ui"; import Link from "next/link"; import { useRouter } from "next/router"; diff --git a/apps/web/src/components/Shared/Profile/Unfollow.tsx b/apps/web/src/components/Shared/Profile/Unfollow.tsx index c7e86fcda878..b2df61190a3f 100644 --- a/apps/web/src/components/Shared/Profile/Unfollow.tsx +++ b/apps/web/src/components/Shared/Profile/Unfollow.tsx @@ -1,3 +1,4 @@ +import { useApolloClient } from "@apollo/client"; import errorToast from "@helpers/errorToast"; import { Leafwatch } from "@helpers/leafwatch"; import { LensHub } from "@hey/abis"; @@ -12,7 +13,6 @@ import { useCreateUnfollowTypedDataMutation, useUnfollowMutation } from "@hey/lens"; -import { useApolloClient } from "@hey/lens/apollo"; import { OptmisticPublicationType } from "@hey/types/enums"; import type { OptimisticTransaction } from "@hey/types/misc"; import { Button } from "@hey/ui"; diff --git a/packages/lens/apollo/index.ts b/packages/lens/apollo/index.ts index 8c21b3f97dfa..66caeccb17a6 100644 --- a/packages/lens/apollo/index.ts +++ b/packages/lens/apollo/index.ts @@ -1,17 +1,4 @@ -import { - ApolloCache, - ApolloProvider, - gql, - useApolloClient, - useQuery -} from "@apollo/client"; +import { ApolloCache, ApolloProvider } from "@apollo/client"; import apolloClient from "./client"; -export { - ApolloCache, - apolloClient, - ApolloProvider, - gql, - useApolloClient, - useQuery -}; +export { ApolloCache, apolloClient, ApolloProvider };