aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 821 forks source link

`amplify pull` is not pulling the changes done manually on the Appsync console to the schema and resolvers #4260

Closed grevolution closed 4 years ago

grevolution commented 4 years ago

Describe the bug We used amplify cli to generate the environment and added api, auth and storage. Then we had to manually change the schema in order to add a new pipeline resolver and a new Query field. After we have done the changes. the amplify pull command is no pulling the changes done on the console.

Pre-Pull and Pos-Pull statuses both showing No Change against Auth, Api and Storage when we definitely have changes against Api.

Amplify CLI Version 4.18.1

To Reproduce 1- generate a new backend using amplify SDK. 2- Add GraphQL API using amplify SDK. 3- Make schema changes manually using AppSync console. (e.g. Add a new field or change existing resolver or add a new pipeline resolver) 4- use amplify pull command to pull those changes.

Expected behavior The changes made in the schema and resolvers should be pulled down and available locally.

Desktop (please complete the following information):

Additional context due to this issue, amplify codegen is also not generating the correct API.swift file. It is not taking the changes done on appsync console into account.

ncohen17 commented 4 years ago

Having the same issue. Please advise

SwaySway commented 4 years ago

Hello @grevolution amplify pull pulls down backend environment changes from the cloud and updates the local environment. Changes made outside of the amplify project are not pulled in. Docs here: https://docs.amplify.aws/cli/start#amplify-pull

kenchoong commented 4 years ago

+1

lucaNationwide commented 3 years ago

+1

massivespace commented 3 years ago

The docs at that link state: "The amplify pull command operates similar to a git pull, fetching upstream backend environment definition changes from the cloud and updating the local environment to match that definition." That's not helpful. Indeed, it may be pulling the environment definition down, but why does that not include manual changes made to the environment? Is there a configuration file of sorts that is a duplicate of what is actually running in AppSync (what you see at the AWS Console), so that making edits at the console diverges the backend configuration from the actual running configuration? I'm not clear on this, but running amplify pull does not bring the resolvers, functions, or schema from the actively running AppSync into the local project. That is certain. I used the AppSync console to create my schema, resolvers, and functions, because 1) it is intuitive and easy to use, and 2) I didn't know enough about Amplify to realize making changes at that console are not supported. I've had those changes in the backend overwritten twice now after upgrading the amplify tool, and it reset my entire schema, functions, and resolvers. After the first amplify upgrade, it lost my backend configuration locally entirely, and this time it overwrote my backend with a very old backend configuration.

I was hoping to find a way to sync the changes I made manually at the AWS AppSync Console back into my project, but it appears that's not possible, in a straight forward CLI approach at least.

flipatoms commented 3 years ago

Have the same problem as above. Used the AppSync console to use an existing DynamoDB and create schema for it. When running amplify pull I don't get the new settings and can't access my existing db from my app. Why was this issue closed?

sydetion commented 3 years ago

Is there a best practise around this issue?

As for my understanding Amplify Pull does not get changes of services like API Gateway / App Sync done in the Console. So Amplify would be useless to create feature rich applications because not aspects might be configurable and deployable?

Please advice!

tostangs commented 3 years ago

It seems like the solution/best practice around this is to somehow know this functionality isn't implemented as one would expect with the amplify pull and to cry at those projects lost thanks to the inability to merge remote changes to local.

mcmoodoo commented 3 years ago

This is still an issue. Why was it closed? What's going on, there is a clear mismatch between the official docs and the actual behavior.

Is amplify team NOT planning on improving their GREAT product?

JoaquinXCP commented 3 years ago

It would be nice to override local changes with the latest version from the cloud running amplify pull --yes. Amplify still needs to be more dev friendly

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.