Skip to content

Commit cf09d2f

Browse files
author
Manu
committed
fix(client): added type to client property
1 parent 47de8a4 commit cf09d2f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/graphqlService.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export type DataInitType = {
1616
};
1717

1818
export class GraphqlService {
19-
_client: any = undefined;
19+
_client: ApolloClient<any> | undefined = undefined;
2020
_token: string | undefined = undefined;
2121
_api = ''; // https://myapi.com
22-
_uri = ''; // /api
23-
_publicUri = ''; // /publicApi
22+
_uri = ''; // /api/
23+
_publicUri = ''; // publicApi
2424

2525
get client() {
2626
return this._client;
@@ -176,7 +176,7 @@ export class GraphqlService {
176176
.catch(observer.error.bind(observer));
177177

178178
return () => {
179-
handle && handle.unsubscribe();
179+
handle?.unsubscribe?.();
180180
};
181181
})
182182
);

src/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ import {
66
useQuery
77
} from '@apollo/client';
88
import gqlClient from './graphqlService';
9+
// export to use
910
export { gqlClient, ApolloClient, ApolloProvider, useMutation, useQuery, gql };

0 commit comments

Comments
 (0)