Skip to content
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-appsync] refactor schema definition mode #9301

Closed
2 tasks done
BryanPan342 opened this issue Jul 28, 2020 · 0 comments · Fixed by #9283
Closed
2 tasks done

[aws-appsync] refactor schema definition mode #9301

BryanPan342 opened this issue Jul 28, 2020 · 0 comments · Fixed by #9283
Assignees
Labels
@aws-cdk/aws-appsync Related to AWS AppSync feature-request A feature should be added or improved. in-progress This issue is being actively worked on. p2

Comments

@BryanPan342
Copy link
Contributor

BryanPan342 commented Jul 28, 2020

Currently appsync schema definition mode is not strongly typed.

Use Case

Make schema definition more clearly configured. Set up for code-first schema definition.

Proposed Solution

by file

const api = new appsync.GraphQLApi(stack, 'api', {
  schemaDefinition: appsync.SchemaDefinition.FILE,
  schemaDefinitionFile: fileLocation
});

by code

const api = new appsync.GraphQLApi(stack, 'api', {
  schemaDefinition: appsync.SchemaDefinition.CODE,
});

api.updateDefinition(definition);
  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@BryanPan342 BryanPan342 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jul 28, 2020
@BryanPan342 BryanPan342 self-assigned this Jul 28, 2020
@BryanPan342 BryanPan342 linked a pull request Jul 28, 2020 that will close this issue
@github-actions github-actions bot added the @aws-cdk/aws-appsync Related to AWS AppSync label Jul 28, 2020
@BryanPan342 BryanPan342 added p2 in-progress This issue is being actively worked on. and removed needs-triage This issue or PR still needs to be triaged. labels Jul 28, 2020
@BryanPan342 BryanPan342 changed the title [aws-appsync] appsync include s3 location support for schema definition [aws-appsync] refactor schema definition mode Jul 30, 2020
@mergify mergify bot closed this as completed in #9283 Jul 31, 2020
mergify bot pushed a commit that referenced this issue Jul 31, 2020
**[ISSUE]**
schema definition mode is not strongly typed.

**[APPROACH]**
Make input prop `schemaDefinition` take a enum that allows users to choose between 2 modes: `CODE` and `FILE`. 

**[NOTE]**
This approach was taken in preparation for a code-first approach to schema generation with CDK. All of the functions tagged `@experimental` are subject to change.

BREAKING CHANGE: **appsync** prop `schemaDefinition` no longer takes string, instead it is required to configure schema definition mode.
- **appsync**: schemaDefinition takes param `SchemaDefinition.XXX` to declare how schema will be configured
  - **SchemaDefinition.CODE** allows schema definition through CDK
  - **SchemaDefinition.FILE** allows schema definition through schema.graphql file

Fixes #9301 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
curtiseppel pushed a commit to curtiseppel/aws-cdk that referenced this issue Aug 11, 2020
**[ISSUE]**
schema definition mode is not strongly typed.

**[APPROACH]**
Make input prop `schemaDefinition` take a enum that allows users to choose between 2 modes: `CODE` and `FILE`. 

**[NOTE]**
This approach was taken in preparation for a code-first approach to schema generation with CDK. All of the functions tagged `@experimental` are subject to change.

BREAKING CHANGE: **appsync** prop `schemaDefinition` no longer takes string, instead it is required to configure schema definition mode.
- **appsync**: schemaDefinition takes param `SchemaDefinition.XXX` to declare how schema will be configured
  - **SchemaDefinition.CODE** allows schema definition through CDK
  - **SchemaDefinition.FILE** allows schema definition through schema.graphql file

Fixes aws#9301 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-appsync Related to AWS AppSync feature-request A feature should be added or improved. in-progress This issue is being actively worked on. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants