Search code examples
flutteraws-amplifygraphql-codegen

How to change destination path for amplify codegen models in Flutter


I follow the tutorial and managed to properly generate models. I wonder how I can choose the destination where models are generated. By default it is lib/models.

How can I change the destination and split generated files between different folders?


Solution

  • For now it is not possible, but the feature was requested and can be tracked here.

    Update 24.05.2023.
    as @rleffler mentioned now it is supported:

    amplify codegen models --output-dir your/path
    

    Unfortunately, models are still generated into lib/modelswhen you run amplify pull so remember to removed them.