File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
examples/vue/apollo-composable Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ import { fileURLToPath } from 'url' ;
12import { defineConfig } from 'vite' ;
23import vue from '@vitejs/plugin-vue' ;
34
45// https://vitejs.dev/config/
56export 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} ) ;
You can’t perform that action at this time.
0 commit comments