You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorial/markdown/nodejs/dataApi-appsync-tutorial/tutorial.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -230,7 +230,7 @@ export function request(ctx) {
230
230
// Build the HTTP request object for the Data API Query Service
231
231
constrequestObject= {
232
232
method:'POST',
233
-
resourcePath:'/_p/query/query/service', // Data API SQL++ endpoint
233
+
resourcePath:'/_p/query/query/service', // Data API SQL++ endpoint - see https://docs.couchbase.com/cloud/data-api-reference/index.html#tag/Query
234
234
params: {
235
235
headers: {
236
236
'Accept':'application/json',
@@ -274,7 +274,7 @@ export function response(ctx) {
274
274
-`ctx.env` provides access to AppSync environment variables (credentials stored securely).
275
275
-`ctx.arguments` gives you the GraphQL args: `city`.
276
276
-`util.base64Encode` is an AppSync helper to encode credentials.
277
-
-`resourcePath` is relative to the HTTP data source base URL.
277
+
-`resourcePath` is the API endpoint path relative to your HTTP data source base URL. In this case, `/_p/query/query/service` is the [Data API Query Service endpoint](https://docs.couchbase.com/cloud/data-api-reference/index.html#tag/Query) for executing SQL++ queries.
278
278
-`query_context` sets the default bucket/scope for SQL++.
279
279
- Using positional parameters (`$1`) in the SQL++ query prevents SQL injection.
280
280
-`parsedResult.results` is the array of documents returned by Data API.
0 commit comments