Skip to content

Commit 9f8ee5b

Browse files
committed
feat: add wss uri
1 parent d3f0990 commit 9f8ee5b

File tree

4 files changed

+316
-199
lines changed

4 files changed

+316
-199
lines changed

packages/app-provider/src/ApolloContainer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const ApolloContainer: React.ComponentType<ApolloContainerProps> = withAuth(
5252
onRequestError: this.props.onRequestError,
5353
onRequestSuccess: this.props.onRequestSuccess,
5454
uri: this.props.uri,
55+
subscriptionUri: this.props.subscriptionUri,
5556
withSubscriptions,
5657
};
5758

packages/app-provider/src/AppProvider.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ type PrefilledApolloContainerProps =
3030
/**
3131
* `AppProvider` universal provider which loads fragments schema and provides Apollo client with it, authentication and table schema.
3232
* @prop {string} [uri] - The 8base API field schema.
33+
* @prop {string} [subscriptionUri] Endpoint of the GraphQl websocket server.
3334
* @prop {Object} [authClient] - The 8base auth client.
3435
* @prop {Function} [onRequestSuccess] - The callback which called when request is success.
3536
* @prop {Function} [onRequestError] - The callback which called when request is fail.
@@ -41,6 +42,7 @@ type PrefilledApolloContainerProps =
4142
*/
4243
const AppProvider = ({
4344
uri,
45+
subscriptionUri,
4446
authClient,
4547
onRequestSuccess,
4648
onRequestError,
@@ -63,6 +65,7 @@ const AppProvider = ({
6365
<ApolloContainer
6466
withSubscriptions={withSubscriptions}
6567
uri={uri}
68+
subscriptionUri={subscriptionUri}
6669
extendLinks={extendLinks}
6770
onRequestSuccess={onRequestSuccess}
6871
onRequestError={onRequestError}

packages/app-provider/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { IAuthState, TableSchema, Application } from '@8base/utils';
44

55
export type ApolloContainerPassedProps = {
66
uri: string;
7+
subscriptionUri?: string;
78
autoSignUp?: boolean;
89
withSubscriptions?: boolean;
910
authProfileId?: string;

0 commit comments

Comments
 (0)