-
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): code-first schema allows for object type definition #9417
Conversation
[TODO]
|
|
||
```ts | ||
import * as appsync from '@aws-cdk/aws-appsync'; | ||
import * as db from '@aws-cdk/aws-dynamodb'; |
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.
import * as db from '@aws-cdk/aws-dynamodb'; | |
import * as ddb from '@aws-cdk/aws-dynamodb'; |
}, | ||
}); | ||
|
||
const demoTable = new db.Table(stack, 'DemoTable', { |
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.
const demoTable = new db.Table(stack, 'DemoTable', { | |
const demoTable = new ddb.Table(stack, 'DemoTable', { |
const demoTable = new db.Table(stack, 'DemoTable', { | ||
partitionKey: { | ||
name: 'id', | ||
type: db.AttributeType.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.
type: db.AttributeType.STRING, | |
type: ddb.AttributeType.STRING, |
const api = new appsync.GraphQLApi(stack, 'Api', { | ||
name: 'demo', | ||
schemaDefinition: appsync.SchemaDefinition.FILE, | ||
schemaDefinitionFile: join(__dirname, 'schema.graphql'), |
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.
might want to provide an example that includes that this file contains
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). |
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 |
@Mergifyio refresh |
Command |
AppSync now able to generate a code-first approach to generating object and interface types through code. You can also append to schema through the
GraphQLApi.appendToSchema
function.Feature List:
All details can be found in the README.md
Fixes #9307
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license