refactor(core): adjust graphql hook (#5339)

This commit is contained in:
EYHN
2023-12-28 07:43:25 +00:00
parent 7e75e19d04
commit 0b9cd00fd3
28 changed files with 137 additions and 119 deletions

View File

@@ -13,8 +13,8 @@ import {
changePasswordMutation,
sendVerifyChangeEmailMutation,
} from '@affine/graphql';
import { fetcher } from '@affine/graphql';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { fetcher, useMutation } from '@affine/workspace/affine/gql';
import { useSetAtom } from 'jotai/react';
import type { ReactElement } from 'react';
import { useCallback } from 'react';
@@ -29,6 +29,7 @@ import { z } from 'zod';
import { SubscriptionRedirect } from '../components/affine/auth/subscription-redirect';
import { useCurrentLoginStatus } from '../hooks/affine/use-current-login-status';
import { useCurrentUser } from '../hooks/affine/use-current-user';
import { useMutation } from '../hooks/use-mutation';
import { RouteLogic, useNavigateHelper } from '../hooks/use-navigate-helper';
const authTypeSchema = z.enum([

View File

@@ -5,7 +5,7 @@ import {
type GetInviteInfoQuery,
getInviteInfoQuery,
} from '@affine/graphql';
import { fetcher } from '@affine/workspace/affine/gql';
import { fetcher } from '@affine/graphql';
import { useSetAtom } from 'jotai';
import { useCallback, useEffect } from 'react';
import { type LoaderFunction, redirect, useLoaderData } from 'react-router-dom';

View File

@@ -1,8 +1,8 @@
import { Button } from '@affine/component/ui/button';
import { type GetCurrentUserQuery, getCurrentUserQuery } from '@affine/graphql';
import { fetcher } from '@affine/graphql';
import { Trans } from '@affine/i18n';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { fetcher } from '@affine/workspace/affine/gql';
import { Logo1Icon } from '@blocksuite/icons';
import { useCallback, useMemo } from 'react';
import {