amplify-cli: Cannot delete a table with the CLI: `Cannot convert undefined or null to object`
Before opening, please confirm:
- I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- I have searched for duplicate or closed issues.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
14.17.0
Amplify CLI Version
4.52.0
What operating system are you using?
Ubuntu
Amplify Categories
api
Amplify Commands
codegen, push
Describe the bug
I want to delete a table with CLI just removing the Type @model, but I can’t.
I have defined the table like this:
type Feedback @model(subscriptions: null) {
id: ID!
stars: Int
comment: String
fromId: ID!
toId: ID!
}
Then, I just wanted to remove it by deleting that @model from the Schema.graphql. But I got this error:

Expected behavior
Delete table and resolvers.
Reproduction steps
I have created the @model like any other.
Just added the @model in the Schema.graphql:
type Feedback @model(subscriptions: null) {
id: ID!
stars: Int
comment: String
fromId: ID!
toId: ID!
hola: String!
}
Then I did amplify push --y and works great, then I deleted from the Schema.graphql and I got the previous error.
GraphQL schema(s)
No response
Log output
No response
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 18 (6 by maintainers)
Hey @dylan-westbury and @MontoyaAndres we have identified the bug and will be submitting a PR to fix this!
same.
4.52.0 not working 4.44.2 woking.
Got it, thank you @MontoyaAndres!