Skip to content

Commit f2a1d44

Browse files
authored
Merge pull request #48 from Selnapenek/master
feat: add wss uri
2 parents d3f0990 + 5e733f1 commit f2a1d44

File tree

7 files changed

+321
-201
lines changed

7 files changed

+321
-201
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;

packages/app-provider/test/__tests__/AppProvider.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ describe('AppProvider', () => {
8686
"onIdTokenExpired": [Function],
8787
"onRequestError": [MockFunction],
8888
"onRequestSuccess": [MockFunction],
89+
"subscriptionUri": undefined,
8990
"uri": "http://8base.com",
9091
"withAuth": true,
9192
"withSubscriptions": false,
@@ -140,6 +141,7 @@ describe('AppProvider', () => {
140141
"onIdTokenExpired": [Function],
141142
"onRequestError": [MockFunction],
142143
"onRequestSuccess": [MockFunction],
144+
"subscriptionUri": undefined,
143145
"uri": "http://8base.com",
144146
"withAuth": true,
145147
"withSubscriptions": false,
@@ -178,6 +180,7 @@ describe('AppProvider', () => {
178180
"extendLinks": [MockFunction],
179181
"onRequestError": [MockFunction],
180182
"onRequestSuccess": [MockFunction],
183+
"subscriptionUri": undefined,
181184
"uri": "http://8base.com",
182185
"withAuth": false,
183186
"withSubscriptions": false,

packages/crud/src/RecordCrud.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const createRecordTag = (tableSchema: TableSchema, mode: CrudModes, options: Que
3232
case 'delete':
3333
return createTableRowDeleteTag([tableSchema], tableSchema.id);
3434
default:
35-
return null;
35+
return '';
3636
}
3737
};
3838

packages/permissions-provider/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"ramda": "^0.26.1"
2525
},
2626
"devDependencies": {
27-
"@types/graphql": "^0.13.0",
27+
"@types/graphql": "^14.2.0",
2828
"@types/jest": "^24.0.13",
2929
"@types/react-test-renderer": "^16.8.1",
3030
"apollo-client": "^2.6.3",

0 commit comments

Comments
 (0)