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

Cannot add createdAt in @key fields without making it available as part of mutation #4362

Closed
darshannahar opened this issue May 24, 2020 · 5 comments · Fixed by #4382
Closed
Labels
graphql-transformer-v1 Issue related to GraphQL Transformer v1 @key Issues tied to @key transformer directive

Comments

@darshannahar
Copy link

darshannahar commented May 24, 2020

Describe the bug
With @model directive createdAt is an autogenerated column in DynamoDB. I want to use it as a sort key. But I do not want to make it available in the mutation input. But amplify forces me to add createdAt as a part of the type and thus makes it available in mutation input.

Amplify CLI Version
4.20.0

To Reproduce
Graphql schema of below type won't be accepted:

type Comment @model @key(fields: ["blogId", "createdAt"]) {
  id: ID!
  content: String!
  blogId: ID!
  blog: Blog! @connection(fields: ["blogId"])
  customerId: ID!
}

Expected behavior
Should allow auto-added columns like createdAt, updatedAt to be part of key

Desktop (please complete the following information):

  • OS: Mac
  • Node Version- 14.2.0
@dtelaroli
Copy link

+1

Same for ID

@ammarkarachi ammarkarachi added @key Issues tied to @key transformer directive graphql-transformer-v1 Issue related to GraphQL Transformer v1 labels May 25, 2020
@darshannahar
Copy link
Author

darshannahar commented May 25, 2020

Found this issue to be duplicate of #1657

@ammarkarachi
Copy link
Contributor

@darshannahar we have a PR linked above closing it as it is a duplicate

@yuth yuth added the pending-release Code has been merged but pending release label Jun 2, 2020
@yuth
Copy link
Contributor

yuth commented Jun 3, 2020

This fix is released in Amplify CLI v4.21.1

@yuth yuth removed the pending-release Code has been merged but pending release label Jun 3, 2020
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
graphql-transformer-v1 Issue related to GraphQL Transformer v1 @key Issues tied to @key transformer directive
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants