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

Creation Status is FAILED with details: Internal Failure while saving the schema. #1362

Open
2 tasks done
zirkelc opened this issue Mar 23, 2023 · 2 comments
Open
2 tasks done
Assignees
Labels

Comments

@zirkelc
Copy link

zirkelc commented Mar 23, 2023

How did you install the Amplify CLI?

npm install -g

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

v18.14.1

Amplify CLI Version

11.0.2

What operating system are you using?

macOS

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

No manual changes made

Describe the bug

If the Schema contains an input type, all nested fields must also be defined as input types. That is the official GraphQL standard.

This Schema is therefore invalid:

type Mutation {
  test(input: TestInput!): Test 
}

# -> input type can only contain scalars (String, Int, ...) and other input types
input TestInput {
  nested: NestedTestInput!
}

# -> error: should be defined as input type
type NestedTestInput {
  id: ID
  name: String!
}

However, when this Amplify project is pushed, it fails with the following error:

🛑 The following resources failed to deploy:
Resource Name: GraphQLAPITransformerSchema3CB2AE18 (AWS::AppSync::GraphQLSchema)
Event Type: update
Reason: Schema Creation Status is FAILED with details: Internal Failure while saving the schema.
URL: ...

🛑 Resource is not in the state stackUpdateComplete
Name: GraphQLAPITransformerSchema3CB2AE18 (AWS::AppSync::GraphQLSchema), Event Type: update, Reason: > > Schema Creation Status is FAILED with details: Internal Failure while saving the schema.

2023-03-23_14-56-26

This error is quite confusing, because it very difficult to figure out the actual issue. There is another seemingly unrelated issue: #1040

Expected behavior

Validate Schema before deployment and show error message that Schema is invalid, for example:

Input type TestInput contains non-input type NestedTestInput on field nested

Reproduction steps

  1. Clone repository: https://github.com/zirkelc/amplify-nested-input-issue
  2. Leave NestedTestInput type commented out
  3. Push to cloud to created stack with amplify push -y
  4. Remove comments for NestedTestInput and nested
  5. Push to cloud again with amplify push -y

Project Identifier

768325cc35028974c561f7d416d382b3

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@AnilMaktala AnilMaktala self-assigned this Mar 23, 2023
@AnilMaktala
Copy link
Member

Hi @zirkelc, Thank you for raising this. After following the steps provided, I have been able to reproduce this issue and I fully concur with your observation that the error message displayed is not useful for the developers. Therefore, I will label this as a bug that needs further evaluation by the team.

image

@Lekha30
Copy link

Lekha30 commented May 11, 2023

I am also facing this issue. Any updates on this please?

@sundersc sundersc self-assigned this Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants