Skip to content

Commit 5509985

Browse files
committed
resolved review comments
1 parent ca6f5c4 commit 5509985

File tree

4 files changed

+5
-28
lines changed

4 files changed

+5
-28
lines changed

value/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ View the [documentation](https://www.ibm.com/docs/en/api-connect/ace/saas?topic=
1010
## Snippets
1111

1212
- [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

value/arguments/api.graphql

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
# To establish a constant value within a type or query, we can utilize this directive.
33
# If no arguments are provided (@value) then the value is null.
44

5-
enum Direction {
6-
NORTH
7-
EAST
8-
SOUTH
9-
WEST
10-
}
11-
125
type Customer {
136
name: String!
147
city: String!
@@ -33,12 +26,4 @@ type Query {
3326
)
3427
# To pass a constant value directly in a query and return the result
3528
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'})"})
4429
}

value/arguments/tests/Test.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ const {
2424
query: '{pi}',
2525
expected: {pi:3.14159},
2626
},
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-
}
3527
]
3628
return deployAndRun(__dirname, tests, stepzen.admin);
3729
});

value/useOfJSON/api.graphql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33

44
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,
66
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
88
lower(value: String): String
99
@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
1111
upper(value: String): String
1212
@value(script: {src: "$uppercase(value)", language: JSONATA})
1313

14-
# To concatenate strings using @value in JSONata
14+
# To concatenate strings using @value in jsonata
1515
concat(a: String, b: String): String
1616
@value(
1717
script: {

0 commit comments

Comments
 (0)