aws-amplify / amplify-category-api

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development. This plugin provides functionality for the API category, allowing for the creation and management of GraphQL and REST based backends for your amplify project.
https://docs.amplify.aws/
Apache License 2.0
89 stars 79 forks source link

Bug: postAuth request template name is wrong when using secondary index @index #96

Open James1218 opened 2 years ago

James1218 commented 2 years ago

Before opening, please confirm:

How did you install the Amplify CLI?

No response

If applicable, what version of Node.js are you using?

No response

Amplify CLI Version

7.6.22

What operating system are you using?

Mac

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

no

Amplify Categories

api

Amplify Commands

codegen

Describe the bug

The postAuth template name is wrong when using @index secondary index. See screenshot image

Expected behavior

The postAuth request template should be "xxxxxx.postAuth.1.req.vtl", but the generated postAuth request template is "xxxxxx.postAuth.1.res.vtl".

Reproduction steps

  1. In any schema, configure a secondary index.
  2. run amplify api gql-compile
  3. see buid/resolvers/xxx.postAuth.1.res.vtl` indicating it's a response template, but it's actually a request template with wrong name.

GraphQL schema(s)

```graphql # Put schemas below this line ```

Log output

``` # Put your logs below this line ```

Additional information

No response

ykethan commented 2 years ago

Hello @James1218, apologies for the delay in a response. Thank you for notifying us. I was able to replicate this in my Amplify application, hence marking this as a bug.