Skip to content

Commit a2d8e4a

Browse files
committed
Try
1 parent 19752e0 commit a2d8e4a

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
export class ApolloError extends Error {
2+
public graphQLErrors: any[];
3+
public clientErrors: any[];
4+
public networkError: any;
5+
public extraInfo: any;
6+
7+
constructor(opts: {
8+
graphQLErrors?: any[];
9+
clientErrors?: any[];
10+
networkError?: any;
11+
errorMessage?: string;
12+
extraInfo?: any;
13+
}) {
14+
super(opts.errorMessage || 'Apollo Client Error');
15+
this.name = 'ApolloError';
16+
this.graphQLErrors = opts.graphQLErrors ?? [];
17+
this.clientErrors = opts.clientErrors ?? [];
18+
this.networkError = opts.networkError;
19+
this.extraInfo = opts.extraInfo;
20+
}
21+
}
22+
23+
export function isApolloError(err: unknown): err is ApolloError {
24+
return err instanceof ApolloError;
25+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
import { fileURLToPath } from 'url';
12
import { defineConfig } from 'vite';
23
import vue from '@vitejs/plugin-vue';
34

45
// https://vitejs.dev/config/
56
export default defineConfig({
67
plugins: [vue()],
8+
vite: {
9+
resolve: {
10+
alias: {
11+
'@apollo/client/core/index.js': fileURLToPath(
12+
new URL('./shims/apollo-v4-compat.ts', import.meta.url),
13+
),
14+
},
15+
},
16+
},
717
});

0 commit comments

Comments
 (0)