-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(aws-cdk/aws-appsync): Union type definition fields suffixed with "id" #17771
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-appsyncRelated to AWS AppSyncRelated to AWS AppSyncbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2
Description
What is the problem?
Union type definition is generated with a weird "id" suffix. Maybe there is a reason?
| this.definition[options.field?.toString() + 'id'] = options.field; |
Consequently, some of our union type are generated in GraphQL (as we have an advanced code first pre-processing using CDK AppSync) like this:
input UpdatePayloadInput {
Type1id: Type1Input
Type2id: Type2Input
}Reproduction Steps
Build a Union type:
const TypeUnion = new appsync.UnionType("TypeUnion", {
definition: [
Type1,
Type2,
],
})
console.log(TypeUnion.definition)This gives out:
{
Type1id: GraphqlType {
type: 'INTERMEDIATE',
// ...
}
},
Type2id: GraphqlType {
type: 'INTERMEDIATE',
// ...
}
}
}What did you expect to happen?
Definition does not contain the "id" suffix.
What actually happened?
"id" is appended to the union type definition.
CDK CLI Version
1.134.0
Framework Version
No response
Node.js Version
16.13.0
OS
macOS 12.0.1 (Monterey)
Language
Typescript
Language Version
4.4.3
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-appsyncRelated to AWS AppSyncRelated to AWS AppSyncbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2