---
schema_version: "1"
id: 370fc2fb13fc86ee4c3ebe8ec245217f0c88d71ca317e5f26cf2b6d1a8acce72
title: Attach Your Database Tables to the AppSync GraphQL API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/security/sf-connect-amazon-rds/guides/attach-tables.md
canonical_url: https://developer.salesforce.com/docs/platform/sf-connect-amazon-rds/guide/attach-tables.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 17684ed2ed23073fcf9a6550fd3ff43b1d35ff6588a1be95c9974ac9ef98dc9f
products:
  - Access Amazon RDS Data Sources Using Salesforce Connect
  - Security
---
# 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](/docs/platform/sf-connect-amazon-rds/references/sf-connect-amazon-rds-reference/attach-discount.html).

1. Update the schema.

   1. From the [Amazon AppSync console](https://console.aws.amazon.com/appsync/), go to the **Schema** page.
   2. In the editor, add the `type` and `input` declarations for the database table. To get the syntax correct, follow the [Graphqlsample_MyOrder](https://github.com/aws-quickstart/quickstart-salesforce-connect-appsync-rds-postgresql/blob/main/samples/postgres-schema.graphql) pattern.
   3. Choose **Save Schema**.

2. Attach the resolver to the query and mutations for the new database table.

   1. In the navigation pane of the Amazon AppSync Console, choose **Schema**.
   2. In the Resolvers section, choose the query or mutation, and then click **Attach**.
   3. 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.

3. Add additional entries in the Parameter Store to capture the table metadata.
   1. Open the [AWS Systems Manager console](https://console.aws.amazon.com/systems-manager/).
   2. In the navigation pane, choose **Parameter Store**.
   3. Follow the [Graphqlsample_MyOrder example](https://github.com/aws-quickstart/quickstart-salesforce-connect-appsync-rds-postgresql/blob/main/samples/postgres-schema.graphql) and create an additional parameter for the database table, including the `fieldTypes` and `keyColumns`.

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.

1. Edit your external data source definition.
2. Sync the metadata so that Salesforce Connect can sync the new objects and fields required for the new database table.
3. Decide where you want to surface this external data in the Salesforce UI, and make the required updates.
