refactor(server): better selfhost deployment (#9036)

This commit is contained in:
forehalo
2024-12-06 01:37:26 +00:00
parent f96f08dcec
commit 0a1fa8911f
24 changed files with 226 additions and 167 deletions

View File

@@ -9,7 +9,7 @@ import type { GraphQLError } from 'graphql';
import { useCallback, useMemo } from 'react';
import type { SWRConfiguration, SWRResponse } from 'swr';
import useSWR from 'swr';
import useSWRImutable from 'swr/immutable';
import useSWRImmutable from 'swr/immutable';
import useSWRInfinite from 'swr/infinite';
/**
@@ -60,7 +60,7 @@ const createUseQuery =
);
const graphqlService = useService(GraphQLService);
const useSWRFn = immutable ? useSWRImutable : useSWR;
const useSWRFn = immutable ? useSWRImmutable : useSWR;
return useSWRFn(
options ? () => ['cloud', options.query.id, options.variables] : null,
options ? () => graphqlService.gql(options) : null,