Amplify-cli: how can I get all resolovers for the AppSync from the cloud?

Created on 14 Oct 2019  路  8Comments  路  Source: aws-amplify/amplify-cli

I used to see all resolvers used in backend under current-cloud-backend folder but noticed recently I no longer see all, but only the one I modified.

What is the best way to get all the resovlers used in the cloud?

I tried amplify env pull --restore but didn't pull.

graphql-transformer pending-response question

All 8 comments

I tried amplify env pull --restore but didn't pull.

Just to clarify did you put your environment name, like amplify env pull prod --restore? I think env pull requires an environment name, although it may default to the current initialized environment without passing in an enviro name.

@monaye
They should be located under
amplify/#current-cloud-backend/api/<API_NAME>/build/resolvers/*

@jkeys-ecg-nmsu
the command should be amplify env pull --restore
https://aws-amplify.github.io/docs/cli-toolchain/quickstart#environment-related-commands

@SwaySway
I don't see the build folder... what command should I run to have it?

You can run amplify api gql-compile

nope.. amplify api gpl-complie didn't create a build folder.

@monaye
amplify api gql-compile will create the build folder in the local file path not in #current-cloud-backend.

By doing a amplify env pull --restore your schema will be restored and by running amplify api gql-compile you will see the build folder in for that schema under the following path
amplify/backend/api/<API_NAME>/build/

@SwaySway
Oh. Sorry, my bad. Didn't check thoroughly.
I see the build folder :) thank you ~

@monaye FYI the doc you link doesn't seem to reflect the current multienv process, they tell you to pull without giving the env name as a parameter, and then don't tell you how to checkout or pull other environments.

They also would then directly conflict with the (limited) actual documentation on how to deploy across multiple environments:

Amplify fits into the standard Git workflow where you switch between different branches using the env command. Similarly to how you will run git checkout BRANCHNAME you will run amplify env checkout ENVIRONMENT_NAME

In any event, amplify env pull prod --restore works if you have a prod env in your project.

On the topic of confusion around env commands, it would be great to know what the expected behavior is when you have env B initialized and run amplify env pull A.

Was this page helpful?
0 / 5 - 0 ratings