MCPcopy Create free account
hub / github.com/aws-samples/aws-appsync-resolver-samples / request

Function request

samples/opensearch/simpleTermQuery.js:11–29  ·  view source on GitHub ↗
(ctx)

Source from the content-addressed store, hash-verified

9 * @returns {*} the request
10 */
11export function request(ctx) {
12 // Replace with actual values, e.g.: post
13 const index = '<index>';
14 return {
15 operation: 'GET',
16 path: `/${index}/_search`,
17 params: {
18 body: {
19 from: 0,
20 size: 50,
21 query: {
22 term: {
23 '<field>': ctx.args.field, // replace with your field
24 },
25 },
26 },
27 },
28 };
29}
30
31/**
32 * Returns the fetched items

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected