-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Describe the bug
I'm using the sample code provided on the AppSync documentation page to create an AppSync + DynamoDB setup. When trying to deploy, an error occurs during stack creation. The error message indicates that the getDemosConsistent field is missing from the Query type in the schema. This error results in the failure of the stack deployment.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
2.175.1 (build afe6e87)
Expected Behavior
AppSync to be successfully deployed
Current Behavior
AppSync deployment fails when using the sample code on the AppSync page:
Do you wish to deploy these changes (y/n)? y
AppSyncSampleDocStack: deploying... [1/1]
AppSyncSampleDocStack: creating CloudFormation changeset...
AppSyncSampleDocStack | 0/11 | 13.02.44 | REVIEW_IN_PROGRESS | AWS::CloudFormation::Stack | AppSyncSampleDocStack User Initiated
AppSyncSampleDocStack | 0/11 | 13.02.53 | CREATE_IN_PROGRESS | AWS::CloudFormation::Stack | AppSyncSampleDocStack User Initiated
AppSyncSampleDocStack | 0/11 | 13.02.56 | CREATE_IN_PROGRESS | AWS::DynamoDB::Table | DemoTable (DemoTableEE720AED)
AppSyncSampleDocStack | 0/11 | 13.02.56 | CREATE_IN_PROGRESS | AWS::AppSync::GraphQLApi | Api (ApiF70053CD)
AppSyncSampleDocStack | 0/11 | 13.02.56 | CREATE_IN_PROGRESS | AWS::CDK::Metadata | CDKMetadata/Default (CDKMetadata)
AppSyncSampleDocStack | 0/11 | 13.02.56 | CREATE_IN_PROGRESS | AWS::IAM::Role | Api/demoDataSource/ServiceRole (ApidemoDataSourceServiceRole927F7DB2)
AppSyncSampleDocStack | 0/11 | 13.02.57 | CREATE_IN_PROGRESS | AWS::IAM::Role | Api/demoDataSource/ServiceRole (ApidemoDataSourceServiceRole927F7DB2) Resource creation Initiated
AppSyncSampleDocStack | 0/11 | 13.02.57 | CREATE_IN_PROGRESS | AWS::CDK::Metadata | CDKMetadata/Default (CDKMetadata) Resource creation Initiated
AppSyncSampleDocStack | 1/11 | 13.02.57 | CREATE_COMPLETE | AWS::CDK::Metadata | CDKMetadata/Default (CDKMetadata)
AppSyncSampleDocStack | 1/11 | 13.02.57 | CREATE_IN_PROGRESS | AWS::DynamoDB::Table | DemoTable (DemoTableEE720AED) Resource creation Initiated
AppSyncSampleDocStack | 1/11 | 13.02.58 | CREATE_IN_PROGRESS | AWS::AppSync::GraphQLApi | Api (ApiF70053CD) Resource creation Initiated
AppSyncSampleDocStack | 2/11 | 13.02.58 | CREATE_COMPLETE | AWS::AppSync::GraphQLApi | Api (ApiF70053CD)
AppSyncSampleDocStack | 2/11 | 13.02.59 | CREATE_IN_PROGRESS | AWS::AppSync::GraphQLSchema | Api/Schema (ApiSchema510EECD7)
AppSyncSampleDocStack | 2/11 | 13.03.00 | CREATE_IN_PROGRESS | AWS::AppSync::GraphQLSchema | Api/Schema (ApiSchema510EECD7) Resource creation Initiated
AppSyncSampleDocStack | 3/11 | 13.03.08 | CREATE_COMPLETE | AWS::DynamoDB::Table | DemoTable (DemoTableEE720AED)
AppSyncSampleDocStack | 4/11 | 13.03.13 | CREATE_COMPLETE | AWS::IAM::Role | Api/demoDataSource/ServiceRole (ApidemoDataSourceServiceRole927F7DB2)
AppSyncSampleDocStack | 5/11 | 13.03.13 | CREATE_COMPLETE | AWS::AppSync::GraphQLSchema | Api/Schema (ApiSchema510EECD7)
AppSyncSampleDocStack | 5/11 | 13.03.13 | CREATE_IN_PROGRESS | AWS::AppSync::DataSource | Api/demoDataSource (ApidemoDataSource0D7ACC56)
AppSyncSampleDocStack | 5/11 | 13.03.14 | CREATE_IN_PROGRESS | AWS::IAM::Policy | Api/demoDataSource/ServiceRole/DefaultPolicy (ApidemoDataSourceServiceRoleDefaultPolicy24A4F220)
AppSyncSampleDocStack | 5/11 | 13.03.15 | CREATE_IN_PROGRESS | AWS::IAM::Policy | Api/demoDataSource/ServiceRole/DefaultPolicy (ApidemoDataSourceServiceRoleDefaultPolicy24A4F220) Resource creation Initiated
AppSyncSampleDocStack | 5/11 | 13.03.15 | CREATE_IN_PROGRESS | AWS::AppSync::DataSource | Api/demoDataSource (ApidemoDataSource0D7ACC56) Resource creation Initiated
AppSyncSampleDocStack | 6/11 | 13.03.15 | CREATE_COMPLETE | AWS::AppSync::DataSource | Api/demoDataSource (ApidemoDataSource0D7ACC56)
AppSyncSampleDocStack | 6/11 | 13.03.15 | CREATE_IN_PROGRESS | AWS::AppSync::Resolver | Api/QueryGetDemosResolver (ApiQueryGetDemosResolver35CC3474)
AppSyncSampleDocStack | 6/11 | 13.03.15 | CREATE_IN_PROGRESS | AWS::AppSync::Resolver | Api/QueryGetDemosConsistentResolver (ApiQueryGetDemosConsistentResolver47D5A89B)
AppSyncSampleDocStack | 6/11 | 13.03.15 | CREATE_IN_PROGRESS | AWS::AppSync::Resolver | Api/MutationAddDemoResolver (ApiMutationAddDemoResolverF80B4AD1)
AppSyncSampleDocStack | 6/11 | 13.03.16 | CREATE_IN_PROGRESS | AWS::AppSync::Resolver | Api/QueryGetDemosResolver (ApiQueryGetDemosResolver35CC3474) Resource creation Initiated
AppSyncSampleDocStack | 6/11 | 13.03.16 | CREATE_IN_PROGRESS | AWS::AppSync::Resolver | Api/QueryGetDemosConsistentResolver (ApiQueryGetDemosConsistentResolver47D5A89B) Resource creation Initiated
AppSyncSampleDocStack | 6/11 | 13.03.16 | CREATE_IN_PROGRESS | AWS::AppSync::Resolver | Api/MutationAddDemoResolver (ApiMutationAddDemoResolverF80B4AD1) Resource creation Initiated
AppSyncSampleDocStack | 7/11 | 13.03.18 | CREATE_COMPLETE | AWS::AppSync::Resolver | Api/QueryGetDemosResolver (ApiQueryGetDemosResolver35CC3474)
AppSyncSampleDocStack | 8/11 | 13.03.18 | CREATE_COMPLETE | AWS::AppSync::Resolver | Api/MutationAddDemoResolver (ApiMutationAddDemoResolverF80B4AD1)
AppSyncSampleDocStack | 8/11 | 13.03.18 | CREATE_FAILED | AWS::AppSync::Resolver | Api/QueryGetDemosConsistentResolver (ApiQueryGetDemosConsistentResolver47D5A89B) Resource handler returned message: "No field named getDemosConsistent found on type Query (Service: AppSync, Status Code: 404, Request ID: 423a3b88-9bb5-4f88-8828-9046df22ad0c)" (RequestToken: 608e266b-724f-c101-3bef-33c1332156da, HandlerErrorCode: NotFound)
AppSyncSampleDocStack | 8/11 | 13.03.18 | CREATE_FAILED | AWS::IAM::Policy | Api/demoDataSource/ServiceRole/DefaultPolicy (ApidemoDataSourceServiceRoleDefaultPolicy24A4F220) Resource creation cancelled
AppSyncSampleDocStack | 8/11 | 13.03.19 | ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack | AppSyncSampleDocStack The following resource(s) failed to create: [ApiQueryGetDemosConsistentResolver47D5A89B, ApidemoDataSourceServiceRoleDefaultPolicy24A4F220]. Rollback requested by user.
AppSyncSampleDocStack | 8/11 | 13.03.21 | DELETE_IN_PROGRESS | AWS::IAM::Policy | Api/demoDataSource/ServiceRole/DefaultPolicy (ApidemoDataSourceServiceRoleDefaultPolicy24A4F220)
AppSyncSampleDocStack | 8/11 | 13.03.21 | DELETE_IN_PROGRESS | AWS::CDK::Metadata | CDKMetadata/Default (CDKMetadata)
AppSyncSampleDocStack | 8/11 | 13.03.21 | DELETE_IN_PROGRESS | AWS::AppSync::Resolver | Api/MutationAddDemoResolver (ApiMutationAddDemoResolverF80B4AD1)
AppSyncSampleDocStack | 8/11 | 13.03.21 | DELETE_IN_PROGRESS | AWS::AppSync::Resolver | Api/QueryGetDemosResolver (ApiQueryGetDemosResolver35CC3474)
AppSyncSampleDocStack | 8/11 | 13.03.21 | DELETE_IN_PROGRESS | AWS::AppSync::Resolver | Api/QueryGetDemosConsistentResolver (ApiQueryGetDemosConsistentResolver47D5A89B)
AppSyncSampleDocStack | 9/11 | 13.03.21 | DELETE_COMPLETE | AWS::IAM::Policy | Api/demoDataSource/ServiceRole/DefaultPolicy (ApidemoDataSourceServiceRoleDefaultPolicy24A4F220)
AppSyncSampleDocStack | 8/11 | 13.03.21 | DELETE_COMPLETE | AWS::CDK::Metadata | CDKMetadata/Default (CDKMetadata)
AppSyncSampleDocStack | 7/11 | 13.03.21 | DELETE_COMPLETE | AWS::AppSync::Resolver | Api/MutationAddDemoResolver (ApiMutationAddDemoResolverF80B4AD1)
AppSyncSampleDocStack | 8/11 | 13.03.21 | DELETE_COMPLETE | AWS::AppSync::Resolver | Api/QueryGetDemosConsistentResolver (ApiQueryGetDemosConsistentResolver47D5A89B)
AppSyncSampleDocStack | 7/11 | 13.03.22 | DELETE_COMPLETE | AWS::AppSync::Resolver | Api/QueryGetDemosResolver (ApiQueryGetDemosResolver35CC3474)
AppSyncSampleDocStack | 7/11 | 13.03.22 | DELETE_IN_PROGRESS | AWS::AppSync::GraphQLSchema | Api/Schema (ApiSchema510EECD7)
AppSyncSampleDocStack | 7/11 | 13.03.22 | DELETE_IN_PROGRESS | AWS::AppSync::DataSource | Api/demoDataSource (ApidemoDataSource0D7ACC56)
AppSyncSampleDocStack | 6/11 | 13.03.23 | DELETE_COMPLETE | AWS::AppSync::GraphQLSchema | Api/Schema (ApiSchema510EECD7)
AppSyncSampleDocStack | 5/11 | 13.03.23 | DELETE_COMPLETE | AWS::AppSync::DataSource | Api/demoDataSource (ApidemoDataSource0D7ACC56)
AppSyncSampleDocStack | 5/11 | 13.03.24 | DELETE_IN_PROGRESS | AWS::AppSync::GraphQLApi | Api (ApiF70053CD)
AppSyncSampleDocStack | 5/11 | 13.03.24 | DELETE_IN_PROGRESS | AWS::IAM::Role | Api/demoDataSource/ServiceRole (ApidemoDataSourceServiceRole927F7DB2)
AppSyncSampleDocStack | 5/11 | 13.03.24 | DELETE_SKIPPED | AWS::DynamoDB::Table | DemoTable (DemoTableEE720AED)
AppSyncSampleDocStack | 4/11 | 13.03.25 | DELETE_COMPLETE | AWS::AppSync::GraphQLApi | Api (ApiF70053CD)
AppSyncSampleDocStack | 3/11 | 13.03.32 | DELETE_COMPLETE | AWS::IAM::Role | Api/demoDataSource/ServiceRole (ApidemoDataSourceServiceRole927F7DB2)
AppSyncSampleDocStack | 4/11 | 13.03.32 | ROLLBACK_COMPLETE | AWS::CloudFormation::Stack | AppSyncSampleDocStack
Failed resources:
AppSyncSampleDocStack | 13.03.18 | CREATE_FAILED | AWS::AppSync::Resolver | Api/QueryGetDemosConsistentResolver (ApiQueryGetDemosConsistentResolver47D5A89B) Resource handler returned message: "No field named getDemosConsistent found on type Query (Service: AppSync, Status Code: 404, Request ID: 423a3b88-9bb5-4f88-8828-9046df22ad0c)" (RequestToken: 608e266b-724f-c101-3bef-33c1332156da, HandlerErrorCode: NotFound)
❌ AppSyncSampleDocStack failed: Error: The stack named AppSyncSampleDocStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "No field named getDemosConsistent found on type Query (Service: AppSync, Status Code: 404, Request ID: 423a3b88-9bb5-4f88-8828-9046df22ad0c)" (RequestToken: 608e266b-724f-c101-3bef-33c1332156da, Ha5A89B) Resource handler returned message: "No field named getDemosConsistent found on type Query (Service: AppSync, Status Code: 404, Request ID: 423a3b88-9bb5-4f88-8828-9046df22ad0c)" (RequestToken: 608e266b-724f-c101-3bef-33c1332156da, HandlerErrorCode: NotFound)
❌ AppSyncSampleDocStack failed: Error: The stack named AppSyncSampleDocStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "No field named getDemosConsistent found on type Query (Service: AppSync, Status Code: 404, Request ID: 423a3b88-9bb5-4f88-8828-9046df22ad0c)" (RequestToken: 608e266b-724f-c101-3bef-33c1332156da, Had on type Query (Service: AppSync, Status Code: 404, Request ID: 423a3b88-9bb5-4f88-8828-9046df22ad0c)" (RequestToken: 608e266b-724f-c101-3bef-33c1332156da, HandlerErrorCode: NotFound)
❌ AppSyncSampleDocStack failed: Error: The stack named AppSyncSampleDocStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "No field named getDemosConsistent found on type Query (Service: AppSync, Status Code: 404, Request ID: 423a3b88-9bb5-4f88-8828-9046df22ad0c)" (RequestToken: 608e266b-724f-c101-3bef-33c1332156da, Ha88-8828-9046df22ad0c)" (RequestToken: 608e266b-724f-c101-3bef-33c1332156da, HandlerErrorCode: NotFound)
❌ AppSyncSampleDocStack failed: Error: The stack named AppSyncSampleDocStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "No field named getDemosConsistent found on type Query (Service: AppSync, Status Code: 404, Request ID: 423a3b88-9bb5-4f88-8828-9046df22ad0c)" (RequestToken: 608e266b-724f-c101-3bef-33c1332156da, Ha❌ AppSyncSampleDocStack failed: Error: The stack named AppSyncSampleDocStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "No field named getDemosConsistent found on type Query (Service: AppSync, Status Code: 404, Request ID: 423a3b88-9bb5-4f88-8828-9046df22ad0c)" (RequestToken: 608e266b-724f-c101-3bef-33c1332156da, HandlerErrorCode: NotFound)
COMPLETE: Resource handler returned message: "No field named getDemosConsistent found on type Query (Service: AppSync, Status Code: 404, Request ID: 423a3b88-9bb5-4f88-8828-9046df22ad0c)" (RequestToken: 608e266b-724f-c101-3bef-33c1332156da, HandlerErrorCode: NotFound)
Reproduction Steps
I have used the same sample code from the AppSync page for DynamoDB. So, the content of my app-stack.js and schema.graphql is exactly the same.
Then, I ran:
cdk bootstrap
cdk deploy
Possible Solution
Changed the sample schema as following:
type demo {
id: String!
version: String!
}
type Query {
getDemos: [ demo! ]
getDemosConsistent: [Demo!]
}
input DemoInput {
version: String!
}
type Mutation {
addDemo(input: DemoInput!): demo
}
Additional Information/Context
No response
CDK CLI Version
2.175.1 (build afe6e87)
Framework Version
No response
Node.js Version
v22.9.0
OS
Windows 11 Home Single Language
Language
TypeScript
Language Version
No response
Other information
No response