Skip to content

AWSLambdaEvents.AppSync.Event incorrect #54

Open
@mufumade

Description

@mufumade

Expected behavior

I am using swift as a appsync lambda resolver with the following GraphQL schema.

input TestInput {
  ids: [String]
}

testMutation(input: TestInput!): String

According to the GraphQL Documentation arrays are allowed. So a correct JSON Decode should happen.

Actual behavior

By setting the message to type of AWSLambdaEvents.AppSync.Event leads to a Unexpected AppSync argument. Expected a String or a Dictionary. error.

Steps to reproduce

{
    "field": "testMutation",
    "arguments": {
        "input": {
            "ids": [
                "id1",
                "id2"
            ]
        }
    }
}

This is a the json payload I get from appsync.

Swift & OS version (output of swift --version && uname -a)

Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)
Target: x86_64-apple-darwin20.4.0
Darwin xx-MacBook-Pro.local 20.4.0 Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:47 PDT 2021; root:xnu-7195.101.2~1/RELEASE_X86_64 x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugFeature doesn't work as expected.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions