The code contains one or more errors.. (Service: AWSAppSync; Status Code: 400; Error Code: BadRequestException, Proxy: null)
pehel opened this issue · 0 comments
pehel commented
get-events.js
import * as ddb from "@aws-appsync/utils/dynamodb";
export function request(ctx) {
const { limit = 20, objType } = ctx.arguments;
return ddb.query({
index: "byStatus",
query: { isActive: { eq: true } },
filter: {
objType: { eq: objType },
},
limit,
nextToken,
});
}
export function response(ctx) {
const { items, nextToken } = ctx.result;
return { items, nextToken };
}
resolvers:
Query.getEvents:
kind: UNIT
dataSource: EventsTable
code: resolvers/js-resolvers/get-events.js
It is a UNIT resolver. If i add previous version of template that includes operation it works fine. I'm not sure if it is coming due to library import.