Attach Your Database Tables to the AppSync GraphQL API
After you implement the example solution outlined here, you can explore how to surface your database tables to Amazon AppSync and Salesforce.
If your database tables are in the same Amazon RDS instance as the example solution, complete these AWS configuration steps. See Attach Applied Discount Database Table.
Update the schema.
Attach the resolver to the query and mutations for the new database table.
- In the navigation pane of the Amazon AppSync Console, choose Schema.
- In the Resolvers section, choose the query or mutation, and then click Attach.
- In Create new resolver, choose the Lambda function from the dropdown list.
Repeat the process to attach the resolver for all the queries and mutations defined in the GraphQL schema. For example, if the Salesforce Connect adapter for GraphQL can perform create, read, update, and delete operations on records, attach the resolver four times.
Add additional entries in the Parameter Store to capture the table metadata.
If your database tables are in a different Amazon RDS instance, you must complete additional configuration steps. Add the Amazon RDS credentials to the Secrets Manager, and set up the port forwarding so that the resolver can have a persistent connection to the RDS. If necessary, contact AWS Support for help with setting up this configuration.
After the new GraphQL type is added to the API endpoint and validated, complete these Salesforce configuration steps.
- Edit your external data source definition.
- Sync the metadata so that Salesforce Connect can sync the new objects and fields required for the new database table.
- Decide where you want to surface this external data in the Salesforce UI, and make the required updates.