-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(aws-cdk/aws-appsync): Union type definition fields suffixed with "id" #17771
Comments
@BryanPan342 do you remember what was the reason for this suffix? |
Hm quite frankly i can't remember why i added the 'id' suffix. I think it might have tried to serve as a catchall if the field didnt exists.. but that doesnt make sense because i made a check beforehand. I dont see any problem changing it to remove the suffix. Also i didnt really think about people using the definition function so this is actuall pretty interesting. |
To be honest, that's because we are doing uncommon usage of this module by generating a lot of GraphQL stuff (applying Relay best pratiques to the generated GraphQL such as input types, payload types, pagination, etc... For now we have just filtered the output from definition to make it work) Hope the module to go out from experimental soon - it works pretty well for our code first usage btw. |
Removing an unnecessary suffix from union definitions. Fixes: #17771 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Removing an unnecessary suffix from union definitions. Fixes: aws#17771 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
What is the problem?
Union type definition is generated with a weird "id" suffix. Maybe there is a reason?
aws-cdk/packages/@aws-cdk/aws-appsync/lib/schema-intermediate.ts
Line 384 in 283ed02
Consequently, some of our union type are generated in GraphQL (as we have an advanced code first pre-processing using CDK AppSync) like this:
Reproduction Steps
Build a Union type:
This gives out:
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
The text was updated successfully, but these errors were encountered: