File tree Expand file tree Collapse file tree 4 files changed +5
-28
lines changed Expand file tree Collapse file tree 4 files changed +5
-28
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,4 @@ View the [documentation](https://www.ibm.com/docs/en/api-connect/ace/saas?topic=
10
10
## Snippets
11
11
12
12
- [ arguments] ( arguments ) shows how sets the element to a constant value
13
- - [ useOfJSON] ( useOfJSON ) shows how to use JSONata language inside ` @value ` directive
13
+ - [ useOfJSON] ( useOfJSON ) shows how to use script-jsonata language inside ` @value ` directive
Original file line number Diff line number Diff line change 2
2
# To establish a constant value within a type or query, we can utilize this directive.
3
3
# If no arguments are provided (@value) then the value is null.
4
4
5
- enum Direction {
6
- NORTH
7
- EAST
8
- SOUTH
9
- WEST
10
- }
11
-
12
5
type Customer {
13
6
name : String !
14
7
city : String !
@@ -33,12 +26,4 @@ type Query {
33
26
)
34
27
# To pass a constant value directly in a query and return the result
35
28
pi :Float ! @value (const :3.14159 )
36
-
37
- # return single emu value
38
- direction : Direction @value (script : {src : " \" EAST\" " })
39
-
40
- # @override with @value
41
- override_value (id : ID ): Customer
42
- @override (from : " elsewhere" )
43
- @value (script : {src : " Object({name: 'mark'})" })
44
29
}
Original file line number Diff line number Diff line change @@ -24,14 +24,6 @@ const {
24
24
query : '{pi}' ,
25
25
expected : { pi :3.14159 } ,
26
26
} ,
27
- { label : "return direction static value" ,
28
- query : '{direction}' ,
29
- expected : { direction :'EAST' } ,
30
- } ,
31
- { label : "return customer(3) with @override " ,
32
- query : '{override_value(id:3){name}}' ,
33
- expected : { override_value :{ name :"mark" } } ,
34
- }
35
27
]
36
28
return deployAndRun ( __dirname , tests , stepzen . admin ) ;
37
29
} ) ;
Original file line number Diff line number Diff line change 2
2
3
3
4
4
type Query {
5
- # To sum a and b using the @value directive within src in JSONata ,
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
7
+ # To convert a string to lowercase format, use @value in jsonata
8
8
lower (value : String ): String
9
9
@value (script : {src : " $lowercase(value)" , language : JSONATA })
10
- # To convert a string to uppercase format, use @value in JSONata
10
+ # To convert a string to uppercase format, use @value in jsonata
11
11
upper (value : String ): String
12
12
@value (script : {src : " $uppercase(value)" , language : JSONATA })
13
13
14
- # To concatenate strings using @value in JSONata
14
+ # To concatenate strings using @value in jsonata
15
15
concat (a : String , b : String ): String
16
16
@value (
17
17
script : {
You can’t perform that action at this time.
0 commit comments