MCPcopy Create free account
hub / github.com/vercel/examples / executeQuery

Function executeQuery

solutions/aws-neptune-analytics/app/api/node/route.ts:14–29  ·  view source on GitHub ↗

* Execute Neptune Analytics query with parameters

(
  queryString: string,
  parameters: Record<string, any>
)

Source from the content-addressed store, hash-verified

12 * Execute Neptune Analytics query with parameters
13 */
14async function executeQuery(
15 queryString: string,
16 parameters: Record<string, any>
17) {
18 const input = {
19 graphIdentifier: GRAPH_ID,
20 queryString,
21 language: NG.QueryLanguage.OPEN_CYPHER,
22 parameters,
23 }
24
25 const cmd = new NG.ExecuteQueryCommand(input)
26 const response = await client.send(cmd)
27 const responseStr = await response.payload.transformToString()
28 return JSON.parse(responseStr)
29}
30
31/**
32 * Handle errors with consistent logging and response format

Callers 4

GETFunction · 0.70
POSTFunction · 0.70
PUTFunction · 0.70
DELETEFunction · 0.70

Calls 1

sendMethod · 0.65

Tested by

no test coverage detected