Closed alire-alavi closed 1 year ago
I faced the same problem, it's probably related with the migration from the V1 to V2 i suggest you to read the documentation for Example in my case this was the problem: `
Query.getBookById:
dataSource: dynamoDBbookTable
request: 'graphql/mapping-templates/Query.getBookById.request.vtl'
response: 'graphql/mapping-templates/Query.getBookById.response.vtl'`
Correction: `
Query.getBookById:
kind: UNIT #i had to specify the kind since the default value is PIPELINE
dataSource: dynamoDBbookTable
request: 'graphql/mapping-templates/Query.getBookById.request.vtl'
response: 'graphql/mapping-templates/Query.getBookById.response.vtl'`
I agree with @WomaWoma, you are probably encountering the error because of using unmatched versions of plugin and serverless framework, take a look at the docs in repo, you might be using the old docs:
I faced the same issue with js resolvers, here's what I did:
ExampleResolver:
type: Query
field: searchTopics
dataSource: APIHandler #dataSource name
kind: UNIT
code: "appsync/Resolver.js"
Using resolvers mapping return the following error on
sls deploy
command: TypeError: Cannot read properties of undefined (reading 'map')