-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(appsync): support union types for code-first approach #10025
Conversation
…asing" This reverts commit f3c77e3.
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.
nice work! some minor suggestions to take a look at before we can merge this one.
const out = 'type Test1 {\n test1: String\n}\ntype Test2 {\n test2: String\n}\nunion UnionTest = Test1 | Test2\n'; | ||
const test1 = new appsync.ObjectType('Test1', { | ||
definition: { test1: t.string }, | ||
}); | ||
const test2 = new appsync.ObjectType('Test2', { | ||
definition: { test2: t.string }, | ||
}); | ||
let stack: cdk.Stack; | ||
let api: appsync.GraphqlApi; |
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.
why not put all of this into a beforeAll()
?
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.
is there a difference between giving it global scope and using beforeAll()?
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.
since i dont have any asynchronous code before the testing I think it's okay to put it in global scope. wdyt?
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Support
Union Types
for code-first approach.Union Types
are special types of Intermediate Types in CDK.Desired GraphQL Union Type
The above GraphQL Union Type can be expressed in CDK as the following:
CDK Code
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license