-
Notifications
You must be signed in to change notification settings - Fork 15
Data schema/fix custom type array bug #619
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
base: main
Are you sure you want to change the base?
Data schema/fix custom type array bug #619
Conversation
// Basic type structure verification - the exact shape is verified in runtime tests | ||
const _typeCheck: ActualArgs = {} as ActualArgs; | ||
|
||
// These assignments should work with your fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am guessing this comment was generated by an LLM. Can you please review/remove all such comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also please add the missing props to the "Enum" type on line 1422?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove any unnecessary white space changes irrelevant to the fix itself from the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding tests! Can you also add test coverage to the ModelSchema.test.ts file as it is more focused on testing custom operations argument inputs? You can refer to PR #617 for these tests
Problem
This PR fixes issue 3330, where generated GraphQL output is wrong for mutation with array of customType.
Before the fix, resource.ts causes
TodoUpsertInput
to be generated incorrectly without an array type.After the fix,
TodoUpsertInput
is generated properly with the Array type:Note that this fix was required to generate the schema properly in the first place. Without this fix, the AppSync schema is generated incorrectly to begin with, setting up codegen for failure when it generates the client side code.
Changes
The only fixes required are in
packages/data-schema/src/SchemaProcessor.ts
, the other changes in this PR were required for the push to work and can otherwise ideally be ignored / omitted.Validation
Unit tests have been added for this new functionality.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.