-
Notifications
You must be signed in to change notification settings - Fork 64
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
fix(appsync-modelgen-plugin): non model type with id field in java #260
Conversation
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.
Have the lint changes from commit hook. Marked as following. Please ignore them.
selectedType?: string, | ||
generate: CodeGenGenerateEnum = CodeGenGenerateEnum.code, | ||
usePipelinedTransformer: boolean = false, | ||
) => { |
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.
lint change
isTimestampFieldsAdded: true, | ||
handleListNullabilityTransparently: true, | ||
usePipelinedTransformer: usePipelinedTransformer, | ||
}, |
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.
lint change
schema: string, | ||
selectedType?: string, | ||
generate: CodeGenGenerateEnum = CodeGenGenerateEnum.code, | ||
) => { |
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.
lint change
@@ -98,7 +115,7 @@ describe('AppSyncModelVisitor', () => { | |||
it('Should generate a class a model with all optional fields except id field', () => { | |||
const schema = /* GraphQL */ ` | |||
type SimpleModel @model { | |||
id: ID!, | |||
id: ID! |
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.
lint change
author: String | ||
book: String | ||
} | ||
`; |
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.
lint change
author: String | ||
book: String | ||
} | ||
`; |
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.
lint change
author: String | ||
book: String | ||
} | ||
`; |
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.
lint change
type ListContainer | ||
@model | ||
{ | ||
type ListContainer @model { |
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.
lint change
@@ -383,11 +398,11 @@ describe('AppSyncModelVisitor', () => { | |||
|
|||
it('should generate class with non-default providers', () => { | |||
const schema = /* GraphQL */ ` | |||
type Employee @model @auth(rules: [{ allow: owner }, { allow: private, provider:"iam" } ]) { | |||
type Employee @model @auth(rules: [{ allow: owner }, { allow: private, provider: "iam" }]) { |
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.
lint change
id: ID! | ||
name: String! | ||
address: String! | ||
ssn: String @auth(rules: [{ allow: groups, provider:"oidc", groups: ["Admins"] }]) | ||
ssn: String @auth(rules: [{ allow: groups, provider: "oidc", groups: ["Admins"] }]) |
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.
lint change
Codecov Report
@@ Coverage Diff @@
## master #260 +/- ##
==========================================
- Coverage 85.53% 85.53% -0.01%
==========================================
Files 144 144
Lines 6609 6614 +5
Branches 1517 1553 +36
==========================================
+ Hits 5653 5657 +4
- Misses 875 883 +8
+ Partials 81 74 -7
Continue to review full report at Codecov.
|
Description of changes
Generate correct output for non-model type with
id
field defined.id
is currently reserved field in model types but not in non-model typesIssue #, if available
fix #231
Description of how you validated changes
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.