This application has been written following the YouTube tutorial from Marcia Villalba.
- the
amplify.yml
has to stay in the repository root, otherwise the build will succeed in Amplify but nothing will get deployed anyway.
npm i @aws-amplify/ui-react aws-amplify bootstrap
Since there environment variables from Amplify are not available when building locally, then we can use this nice trick in the package.json
run commands:
env-cmd -f .env.local react-scripts start
npm i @aws-cdk/aws-appsync cdk-appsync-transformer
cd frontend/src/graphql
amplify add codegen
? Choose the type of app that you're building javascript
? What javascript framework are you using react
? Choose the code generation language target javascript
? Enter the file name pattern of graphql queries, mutations and subscriptions **\*.js
? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions Yes
? Enter maximum statement depth [increase from default if your schema is deeply nested] 2