File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
tutorial/markdown/nodejs/dataApi-appsync-tutorial Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ export function request(ctx) {
200200
201201 // Construct a SQL++ query to filter hotels by city
202202 // The query_context below lets us use "hotel" instead of "travel-sample.inventory.hotel"
203- const sql_query = ` SELECT c.* FROM ${ collection} AS c WHERE city = $city ` ;
203+ const sql_query = ` SELECT c.* FROM ${ collection} AS c WHERE city = $1 ` ;
204204
205205 // Build the HTTP request object for the Data API Query Service
206206 const requestObject = {
@@ -215,7 +215,7 @@ export function request(ctx) {
215215 body: JSON .stringify ({
216216 query_context: ` default:${ bucket} .${ scope} ` , // Namespace shortcut
217217 statement: sql_query, // The SQL++ query
218- args: { city: city } , // Pass parameters securely
218+ args: [ city ] , // Pass parameters securely
219219 timeout: ' 30m' // Query timeout (generous for demo)
220220 })
221221 }
You can’t perform that action at this time.
0 commit comments