* Which Category is your question related to? *
GraphQL Schema + amplify codegen / transformer
* What AWS Services are you utilizing? *
* Provide additional details e.g. code snippets *
My schema with 12+ @model can not be push due to CloudFormation stack number and/or template size limitation. (2 of them are related to many-to-many relations)
I can see 3 ways to bypass this problem:
Do you have already solve this kind of problem and what was your feedback?
Thanks
Am I the only one having to solve this?
Hey @MatthieuLab. I am actively working on a change that will add support for nested stacks to the transform to solve for this use case. You are not alone as there have been other issues mentioning this in the past (see #185). We have made good progress but this change impacts a lot of different parts and requires refactoring of our tests etc. This change is blocking a number of other features so is a very high priority item.
@mikeparisstuff thanks for your feedback. Would love to have an ETA.
So what have my team done to solve this?
If it can help others, it seems to be straight forward and OK.
Carefull, do not push without -no-gql-override flag
Matthieu
PS: I really hope that we'll be able to also have a 'amplify pull' command.
@MatthieuLab Are you using cloudformation to update the resolvers?
@MatthieuLab Are you using cloudformation to update the resolvers?
@rajababu3 nope, directly the AppSync Console with the Create Resource button to create the DynamoDB table (which I suppose is out of the CloudFormation previously created stack)
Some other potential workarounds while we wait...
I was able to run json-minify on cloudformation-template.json just before amplify writes the resource.
I'm sure there's a better way to do it, but I brute forced it by waiting for the "Do you want to generate GraphQL statements..." prompt, then opening a second terminal, then minifying the template.
The template minifies to about a third the original size. This is strictly whitespace removal.
If the json-minify approach is sound, I would suggest modifying the cli to support this. I took a quick look, but wasn't sure where the best place to do so would be.
You can also shrink the size of the template with a more granular model configuration. For example...
type Attachment
@model(mutations: { create: "createAttachment" }, subscriptions: null)
This will stop the creation of subscriptions, and delete/update resolvers. I actually think this is a feature, as I can match the mutations, queries and subscriptions to the natural semantics of the domain model. (Note: removing subscriptions doesn't have a material impact on template size, but the "CRUDL" queries and mutations do).
Closing this issue since it's a duplicate of #185 and the fix for this issue is currently in PR stage.
Most helpful comment
Hey @MatthieuLab. I am actively working on a change that will add support for nested stacks to the transform to solve for this use case. You are not alone as there have been other issues mentioning this in the past (see #185). We have made good progress but this change impacts a lot of different parts and requires refactoring of our tests etc. This change is blocking a number of other features so is a very high priority item.