Skip to content

Commit 010f822

Browse files
committed
deprecates where argument's valueString
1 parent 3e262ce commit 010f822

File tree

3 files changed

+45
-28
lines changed

3 files changed

+45
-28
lines changed

src/batch/journey.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ describe('batch deleting', () => {
359359
.withClassName(thingClassName)
360360
.withWhere({
361361
operator: 'Equal',
362-
valueString: 'bar1',
362+
valueText: 'bar1',
363363
path: ['stringProp'],
364364
})
365365
.withDryRun(true)
@@ -373,7 +373,7 @@ describe('batch deleting', () => {
373373
where: {
374374
operands: null,
375375
operator: 'Equal',
376-
valueString: 'bar1',
376+
valueText: 'bar1',
377377
path: ['stringProp'],
378378
},
379379
});
@@ -397,7 +397,7 @@ describe('batch deleting', () => {
397397
.withClassName(otherThingClassName)
398398
.withWhere({
399399
operator: 'Like',
400-
valueString: 'foo3',
400+
valueText: 'foo3',
401401
path: ['stringProp'],
402402
})
403403
.withDryRun(true)
@@ -411,7 +411,7 @@ describe('batch deleting', () => {
411411
where: {
412412
operands: null,
413413
operator: 'Like',
414-
valueString: 'foo3',
414+
valueText: 'foo3',
415415
path: ['stringProp'],
416416
},
417417
});
@@ -430,7 +430,7 @@ describe('batch deleting', () => {
430430
.withClassName(otherThingClassName)
431431
.withWhere({
432432
operator: 'Equal',
433-
valueString: 'doesNotExist',
433+
valueText: 'doesNotExist',
434434
path: ['stringProp'],
435435
})
436436
.do()
@@ -442,7 +442,7 @@ describe('batch deleting', () => {
442442
where: {
443443
operands: null,
444444
operator: 'Equal',
445-
valueString: 'doesNotExist',
445+
valueText: 'doesNotExist',
446446
path: ['stringProp'],
447447
},
448448
});
@@ -462,7 +462,7 @@ describe('batch deleting', () => {
462462
.withClassName(otherThingClassName)
463463
.withWhere({
464464
operator: 'LessThan',
465-
valueString: inAMinute,
465+
valueText: inAMinute,
466466
path: ['_creationTimeUnix'],
467467
})
468468
.withOutput('verbose')
@@ -476,7 +476,7 @@ describe('batch deleting', () => {
476476
where: {
477477
operands: null,
478478
operator: 'LessThan',
479-
valueString: inAMinute,
479+
valueText: inAMinute,
480480
path: ['_creationTimeUnix'],
481481
},
482482
});

src/graphql/getter.test.ts

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,23 @@ describe('where filters', () => {
119119
query: jest.fn(),
120120
};
121121

122+
const expectedQuery = `{Get{Person(where:{operator:Equal,valueText:"John Doe",path:["name"]}){name}}}`;
123+
const where: WhereFilter = {
124+
operator: 'Equal',
125+
valueText: 'John Doe',
126+
path: ['name'],
127+
};
128+
129+
new Getter(mockClient).withClassName('Person').withFields('name').withWhere(where).do();
130+
131+
expect(mockClient.query).toHaveBeenCalledWith(expectedQuery);
132+
});
133+
134+
test('a query with a deprecated valueString', () => {
135+
const mockClient: any = {
136+
query: jest.fn(),
137+
};
138+
122139
const expectedQuery = `{Get{Person(where:{operator:Equal,valueString:"John Doe",path:["name"]}){name}}}`;
123140
const where: WhereFilter = {
124141
operator: 'Equal',
@@ -1243,9 +1260,9 @@ describe('generative search', () => {
12431260
new Getter(mockClient)
12441261
.withClassName('Mammal')
12451262
.withGenerate({
1246-
singlePrompt: `Which mammals
1247-
can survive
1248-
in Antarctica?`,
1263+
singlePrompt: `Which mammals
1264+
can survive
1265+
in Antarctica?`,
12491266
})
12501267
.withFields('name taxonomy')
12511268
.do();
@@ -1278,14 +1295,14 @@ in Antarctica?`,
12781295
.withClassName('Mammal')
12791296
.withFields('name taxonomy')
12801297
.withGenerate({
1281-
groupedTask: `Tell
1282-
me
1283-
about
1284-
how
1285-
polar
1286-
bears
1287-
keep
1288-
warm`,
1298+
groupedTask: `Tell
1299+
me
1300+
about
1301+
how
1302+
polar
1303+
bears
1304+
keep
1305+
warm`,
12891306
})
12901307
.do();
12911308

src/graphql/journey.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ describe('the graphql journey', () => {
481481
.withClassName('Article')
482482
.withWhere({
483483
path: ['title'],
484-
valueString: 'apple',
484+
valueText: 'apple',
485485
operator: 'Equal',
486486
})
487487
.withLimit(10)
@@ -757,7 +757,7 @@ describe('the graphql journey', () => {
757757
.withWhere({
758758
operator: 'Equal',
759759
path: ['_id'],
760-
valueString: 'abefd256-8574-442b-9293-9205193737e0',
760+
valueText: 'abefd256-8574-442b-9293-9205193737e0',
761761
})
762762
.withFields('meta { count }')
763763
.do()
@@ -819,7 +819,7 @@ describe('the graphql journey', () => {
819819
.withWhere({
820820
operator: 'Equal',
821821
path: ['_id'],
822-
valueString: 'abefd256-8574-442b-9293-9205193737e0',
822+
valueText: 'abefd256-8574-442b-9293-9205193737e0',
823823
})
824824
.withFields('meta { count }')
825825
.do()
@@ -843,7 +843,7 @@ describe('the graphql journey', () => {
843843
.withWhere({
844844
operator: 'Equal',
845845
path: ['_id'],
846-
valueString: 'abefd256-8574-442b-9293-9205193737e0',
846+
valueText: 'abefd256-8574-442b-9293-9205193737e0',
847847
})
848848
.withFields('meta { count }')
849849
.do()
@@ -867,7 +867,7 @@ describe('the graphql journey', () => {
867867
.withWhere({
868868
operator: 'Equal',
869869
path: ['_id'],
870-
valueString: 'abefd256-8574-442b-9293-9205193737e0',
870+
valueText: 'abefd256-8574-442b-9293-9205193737e0',
871871
})
872872
.withFields('meta { count }')
873873
.do()
@@ -888,7 +888,7 @@ describe('the graphql journey', () => {
888888
.withWhere({
889889
operator: 'Equal',
890890
path: ['_id'],
891-
valueString: 'abefd256-8574-442b-9293-9205193737e0',
891+
valueText: 'abefd256-8574-442b-9293-9205193737e0',
892892
})
893893
.withFields('meta { count }')
894894
.do()
@@ -909,7 +909,7 @@ describe('the graphql journey', () => {
909909
.withWhere({
910910
operator: 'Equal',
911911
path: ['_id'],
912-
valueString: 'abefd256-8574-442b-9293-9205193737e0',
912+
valueText: 'abefd256-8574-442b-9293-9205193737e0',
913913
})
914914
.withFields('meta { count }')
915915
.do()
@@ -1127,7 +1127,7 @@ describe('the graphql journey', () => {
11271127
.withWhere({
11281128
path: ['_creationTimeUnix'],
11291129
operator: 'Equal',
1130-
valueString: expected.data.Get.Article[0]._additional.creationTimeUnix,
1130+
valueText: expected.data.Get.Article[0]._additional.creationTimeUnix,
11311131
})
11321132
.do()
11331133
.then((res: any) => {
@@ -1156,7 +1156,7 @@ describe('the graphql journey', () => {
11561156
.withWhere({
11571157
path: ['_lastUpdateTimeUnix'],
11581158
operator: 'Equal',
1159-
valueString: expected.data.Get.Article[0]._additional.lastUpdateTimeUnix,
1159+
valueText: expected.data.Get.Article[0]._additional.lastUpdateTimeUnix,
11601160
})
11611161
.do()
11621162
.then((res: any) => {

0 commit comments

Comments
 (0)