Skip to content

Commit ddbabc5

Browse files
committed
jsonata version
1 parent 1507c18 commit ddbabc5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

transforms/filter/api.graphql

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,17 @@ type Query {
2626
"""
2727
)
2828
}
29+
30+
# jsonata transforms provdes an alternate method for filtering
31+
# customer_1 uses the [ ... ] filter to return all "customers" ($) that
32+
# contain name = the argument name
33+
# jsonata has quirks: if you leave out the outer []
34+
35+
extend type Query {
36+
customer_1(name: String!): [Customer]
37+
@rest(
38+
endpoint: "https://sample-api.us-east-a.apiconnect.automation.ibm.com/api/customers"
39+
transforms: [ { editor:"""jsonata:$[name = $get("name") ]"""}
40+
])
41+
42+
}

0 commit comments

Comments
 (0)