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

Delete Blog Input has ID (primary key) string or null or undefined with typescript. #128

Closed
apoorvmote opened this issue Oct 11, 2019 · 3 comments
Assignees

Comments

@apoorvmote
Copy link

Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the
Amplify Console GitHub Issue Tracker

Describe the bug
A clear and concise description of what the bug is.
After generating typescript code for simple schema Blog has id (string) & title (string). In API.ts you find following code

export type DeleteBlogInput = {
  id?: string | null,
};

How it's possible to delete blog with undefined or null id. However at AppSync console with graphiql it is showing that id (string) is required to delete note.

I deleted API and created again few times & also generated code with amplify codegen

To Reproduce
Steps to reproduce the behavior:
create react app
amplify init
amplify add api
schema is simple

type Blog @model {
     id: ID!
     title: string!
}

amplify push

Expected behavior
I would expect to have following generated code

export type DeleteBlogInput = {
  id: string,
};

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macOS Catalina
  • Browser: Chrome
  • Version: 77

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@kaustavghosh06 kaustavghosh06 assigned SwaySway and unassigned nikhname Feb 10, 2020
SwaySway referenced this issue in SwaySway/amplify-cli Jan 7, 2021
make primary key non nullable on delete input

fix #2564
@kaustavghosh06 kaustavghosh06 transferred this issue from aws-amplify/amplify-cli Mar 26, 2021
@AaronZyLee
Copy link
Contributor

AaronZyLee commented Mar 31, 2021

Currently the tranformer generates nullable ID field in delete input. This issue will be fixed by aws-amplify/amplify-cli#6337.

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@apoorvmote
Copy link
Author

Its been couple of years since I opened this issue. Also I no longer use graphql for mutation instead I use HTTP API and lambda. I feel the power of graphql is in querying related data NOT for single mutation like delete or post or update.

And nobody else has this issue only I had this issue so I will close it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants