Skip to content

Commit 9656a66

Browse files
committed
feat
1 parent 5aa45b1 commit 9656a66

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/LiveQueryClient.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class LiveQueryClient {
196196
const where = queryJSON.where;
197197
const keys = queryJSON.keys?.split(',');
198198
const watch = queryJSON.watch?.split(',');
199+
const include = queryJSON.include?.split(',');
199200
const subscribeRequest = {
200201
op: OP_TYPES.SUBSCRIBE,
201202
requestId: this.requestId,
@@ -204,6 +205,7 @@ class LiveQueryClient {
204205
where,
205206
keys,
206207
watch,
208+
include,
207209
},
208210
sessionToken: undefined as string | undefined,
209211
};
@@ -294,6 +296,7 @@ class LiveQueryClient {
294296
const where = queryJSON.where;
295297
const keys = queryJSON.keys?.split(',');
296298
const watch = queryJSON.watch?.split(',');
299+
const include = queryJSON.include?.split(',');
297300
const className = query.className;
298301
const sessionToken = subscription.sessionToken;
299302
const subscribeRequest = {
@@ -304,6 +307,7 @@ class LiveQueryClient {
304307
where,
305308
keys,
306309
watch,
310+
include,
307311
},
308312
sessionToken: undefined as string | undefined,
309313
};

src/__tests__/LiveQueryClient-test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,7 @@ describe('LiveQueryClient', () => {
789789
};
790790
const query = new ParseQuery('Test');
791791
query.equalTo('key', 'value');
792+
query.include(['key']);
792793

793794
const subscribePromise = liveQueryClient.subscribe(query);
794795
const clientSub = liveQueryClient.subscriptions.get(1);
@@ -809,6 +810,7 @@ describe('LiveQueryClient', () => {
809810
where: {
810811
key: 'value',
811812
},
813+
include: ['key'],
812814
},
813815
});
814816
});
@@ -826,6 +828,7 @@ describe('LiveQueryClient', () => {
826828
};
827829
const query = new ParseQuery('Test');
828830
query.equalTo('key', 'value');
831+
query.include(['key']);
829832

830833
const subscribePromise = liveQueryClient.subscribe(query, 'mySessionToken');
831834
const clientSub = liveQueryClient.subscriptions.get(1);
@@ -848,6 +851,7 @@ describe('LiveQueryClient', () => {
848851
where: {
849852
key: 'value',
850853
},
854+
include: ['key'],
851855
},
852856
});
853857
});
@@ -946,6 +950,7 @@ describe('LiveQueryClient', () => {
946950
query.equalTo('key', 'value');
947951
query.select(['key']);
948952
query.watch(['key']);
953+
query.include(['key']);
949954
liveQueryClient.subscribe(query);
950955
liveQueryClient.connectPromise.resolve();
951956

@@ -965,6 +970,7 @@ describe('LiveQueryClient', () => {
965970
},
966971
keys: ['key'],
967972
watch: ['key'],
973+
include: ['key'],
968974
},
969975
});
970976
});
@@ -984,6 +990,7 @@ describe('LiveQueryClient', () => {
984990
query.equalTo('key', 'value');
985991
query.select(['key']);
986992
query.watch(['key']);
993+
query.include(['key']);
987994
liveQueryClient.subscribe(query, 'mySessionToken');
988995
liveQueryClient.connectPromise.resolve();
989996

@@ -1004,6 +1011,7 @@ describe('LiveQueryClient', () => {
10041011
},
10051012
keys: ['key'],
10061013
watch: ['key'],
1014+
include: ['key'],
10071015
},
10081016
});
10091017
});

0 commit comments

Comments
 (0)