Fix frontend tests (#6585)

Fix a few broken tests
This commit is contained in:
Félix Malfait
2024-08-09 08:38:01 +02:00
committed by GitHub
parent ab12d9e8da
commit f2cc385710
17 changed files with 86 additions and 347 deletions

View File

@ -23,7 +23,7 @@ import { loggerLink } from '../utils';
const logger = loggerLink(() => 'Twenty');
export interface Options<TCacheShape> extends ApolloClientOptions<TCacheShape> {
onError?: (err: GraphQLFormattedError | undefined) => void;
onError?: (err: readonly GraphQLFormattedError[] | undefined) => void;
onNetworkError?: (err: Error | ServerParseError | ServerError) => void;
onTokenPairChange?: (tokenPair: AuthTokenPair) => void;
onUnauthenticatedError?: () => void;
@ -80,9 +80,8 @@ export class ApolloFactory<TCacheShape> implements ApolloManager<TCacheShape> {
const errorLink = onError(
({ graphQLErrors, networkError, forward, operation }) => {
if (isDefined(graphQLErrors)) {
onErrorCb?.(graphQLErrors);
for (const graphQLError of graphQLErrors) {
onErrorCb?.(graphQLError);
if (graphQLError.message === 'Unauthorized') {
return fromPromise(
renewToken(uri, this.tokenPair)