Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWSLambdaEvents.AppSync.Event incorrect #54

Open
mufumade opened this issue Jun 9, 2021 · 5 comments
Open

AWSLambdaEvents.AppSync.Event incorrect #54

mufumade opened this issue Jun 9, 2021 · 5 comments
Labels
kind/bug Feature doesn't work as expected.

Comments

@mufumade
Copy link
Contributor

mufumade commented Jun 9, 2021

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

@mufumade
Copy link
Contributor Author

mufumade commented Jun 9, 2021

After having a look at the code ... Integer values are also not supported
As a result this will also fail:

{
    "field": "testMutation",
    "arguments": {
        "input": {
            "ids": [
                2,
                3
            ]
        }
    }
}

@tomerd
Copy link
Contributor

tomerd commented Jun 29, 2021

thanks for reporting @mufumade, would you like to make a PR to address this?

@mufumade
Copy link
Contributor Author

@tomerd Yes absolutely. I am a bit busy lately so it might take a few days.

@sebsto
Copy link
Contributor

sebsto commented May 29, 2024

Looks like this is not fixed
https://github.com/swift-server/swift-aws-lambda-events/blob/main/Sources/AWSLambdaEvents/AppSync.swift#L21

@mufumade Are you stil interested to submit a PR on Lambda event project ?

@sebsto
Copy link
Contributor

sebsto commented May 29, 2024

This issue must be migrated to Lambda events

@sebsto sebsto transferred this issue from swift-server/swift-aws-lambda-runtime May 29, 2024
@sebsto sebsto added the kind/bug Feature doesn't work as expected. label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Feature doesn't work as expected.
Projects
None yet
Development

No branches or pull requests

3 participants