aheissenberger / serverless-appsync-offline

Serverless AWS AppSync Offline Plugin - Allow to run AppSync locally for serverless framework
MIT License
90 stars 25 forks source link

Support for pipeline resolvers #23

Closed ntrp closed 5 years ago

ntrp commented 5 years ago

I am not sure if already supported but currently it does not seem to work.

    mappingTemplates:
      - dataSource: Messages
        type: Query
        field: getMessages
        request: "Query.getMessages-req.vtl"
        response: "Query.getMessages-res.vtl"
      - dataSource: Messages
        type: Query
        field: getMessage
        request: "Query.getMessage-req.vtl"
        response: "Query.getMessage-res.vtl"
      - type: Mutation
        field: createMessage
        request: "Wrap-req.vtl"
        response: "Wrap-res.vtl"
        kind: PIPELINE
        functions:
          - authFunction
          - createMessageFunction
    functionConfigurations:
      - dataSource: Auth
        name: authFunction
        request: "Auth-req.vtl"
        response: "Auth-res.vtl"
      - dataSource: Messages
        name: createMessageFunction
        request: "Mutation.createMessage-req.vtl"
        response: "Mutation.createMessage-res.vtl"

This is my configuration and it work online but not offline. The error is:

{
  "errors": [
    {
      "message": "Cannot read property 'name' of undefined",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "createMessage"
      ]
    }
  ],
  "data": null
}

Is it supposed to work? If not is there a plan on supporting it? If any other information is needed please let me know!

aheissenberger commented 5 years ago

Hi @ntrp - this lib is a wrapper for appsync-emulator-serverless - please rise an issue there to get a proper answer.

chaitanya11 commented 4 years ago

It seems issue has been already these since 2018, but no progress. https://github.com/ConduitVC/aws-utils/issues/59

chaitanya11 commented 4 years ago

Do we have any other alternatives ?