File tree Expand file tree Collapse file tree 2 files changed +1
-15
lines changed Expand file tree Collapse file tree 2 files changed +1
-15
lines changed Original file line number Diff line number Diff line change 4
4
type Query {
5
5
# To sum a and b using the @value directive within src in jsonata,
6
6
sum (a : Int ! , b : Int ! ): Int ! @value (script : {src : " a+b" , language : JSONATA })
7
- # To convert a string to lowercase format, use @value in jsonata
8
- lower (value : String ): String
9
- @value (script : {src : " $lowercase(value)" , language : JSONATA })
10
- # To convert a string to uppercase format, use @value in jsonata
11
- upper (value : String ): String
12
- @value (script : {src : " $uppercase(value)" , language : JSONATA })
13
7
14
8
# To concatenate strings using @value in jsonata
15
9
concat (a : String , b : String ): String
Original file line number Diff line number Diff line change @@ -8,18 +8,10 @@ const {
8
8
9
9
describe ( testDescription , function ( ) {
10
10
const tests = [
11
- { label : "return sum of two input using @value with JSONATA " ,
11
+ { label : "return sum of two input using @value with script-json " ,
12
12
query : '{sum(a: 10, b: 10)}' ,
13
13
expected : { sum : 20 } ,
14
14
} ,
15
- { label : "convert lower string" ,
16
- query : '{lower(value: "mIAmI")}' ,
17
- expected : { lower : 'miami' } ,
18
- } ,
19
- { label : "convert upper string" ,
20
- query : '{upper(value: "mIaMi")}' ,
21
- expected : { upper : 'MIAMI' } ,
22
- } ,
23
15
{ label : "concat string" ,
24
16
query : '{concat(a: "Steve",b:"Jobs" )}' ,
25
17
expected : { concat : 'Steve-Jobs' } ,
You can’t perform that action at this time.
0 commit comments