- Install Create React App CLI
npm install -g create-react-app - Install the AWS Amplify CLI
npm install -g @aws-amplify/cli
-
Step1: Add custom type to the schema
- Add custom
Query,MutationorSubscriptiontype to your schema.
- Add custom
-
Step2: Create custom resolver template
- Request and response template should be located in
<project-root>/amplify/backend/api/<api-name>/resolversfolder. - Graphql Transformer follows
<TypeName>.<FieldName>.<req/res>.vltas convention to name the resolvers.- Request template:
Query.myCustomQuery.req.vtl - Response template:
Query.myCustomQuery.res.vtl
- Request template:
- Request and response template should be located in
-
Step3: Add resolvers resource by creating a custom stack
- By default, there is a file called
CustomResources.jsonin<project-root>/amplify/backend/api/<api-name>/stacksdirectory of your API. - Example: CustomResource.json
- By default, there is a file called