This is an application example provided by the fullstack serverless book you can find here
Once the SPA application is setup we proceed to add amplify to our dependencies:
yarn add aws-amplify
Afterwards we need to setup our amplify project:
amplify init
Then we add the GraphQL API:
amplify add api
When made all the desired changes to the GraphQL schema recently created, we need to push our changes.
amplify push
That's it.