1

I am trying to get a serverless app sync resolver deployed and I am following the documentation on Github under "Inline Datasources". The documentation suggests that the following should be enough to create a resolver with a lambda datasource inline:

The following snippet shows the example:

appSync:
  resolvers:
    Query.user:
      dataSource:
        type: 'AWS_LAMBDA'
        config:
          function:
            timeout: 30
            handler: 'functions/getUser.handler'

When I try to follow this example (shown below):

resolvers:
    Query.get_data:
      dataSource:
        type: AWS_LAMBDA
        config:
          function:
            timeout: 30
            handler: "functions/get_data.handler"

I get the following error:

Warning: Invalid AppSync Configuration:
     at appSync/resolvers/Query.get_data: must have required property 'functions'
     at appSync/resolvers: contains invalid resolver definitions

I am not sure what this error really means, if someone has got a working example of this I would appreciate seeing where I have gone wrong as its a really simple example and is pretty much straight from the documentation.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
berimbolo
  • 3,319
  • 8
  • 43
  • 78

1 Answers1

3

I have solved this and it might prove helpful for someone else, I was missing something in the docs which is not shown in the example, the default type is pipeline resolver which means it does require the functions block.

Adding the kind property to resolvers.Query.my_query in my sls config resolved this issue:

kind: UNIT
berimbolo
  • 3,319
  • 8
  • 43
  • 78