Describe the bug
Running amplify codegen repeatedly with no actual changes in AppSync UI makes schema.json constantly change.
To Reproduce
Run amplify codegen multiple times without changing anything in the appsync console.
Expected behavior
If there is no change in graphql schema / resolvers then there should be no change in local schema.json or anything else.
Screenshots
Screenshots of the diffs of schema.json after each amplify codegen.



Desktop (please complete the following information):
Additional context
It seems it's just flipping stuff back and forth. If src/graphql/schema.json is expected to be commit in git then this is annoying.
@hisham We download the schema from the AppSync service each time you run the codegen command and since the schema is a JSON object, there isn't a way to order it. What you could do is that you could use the -nodownload flag along with the codegen command which won't download the new schema.json file each time you run a codegen command.
I see. Ok thanks for the info. I'll try that.
Internally, there could be a step to sort the JSON keys like https://github.com/substack/json-stable-stringify so that each run would create a consistently ordered schema.
@hisham I beleve this issue if fixed. Please let me know if you still see this.
Most helpful comment
Internally, there could be a step to sort the JSON keys like https://github.com/substack/json-stable-stringify so that each run would create a consistently ordered schema.