Develop a connector
After you add a connector to your extension, you need to develop the connector to work with your data source type.
This document provides information on the steps to develop your connector and the options available for each. We recommend that you start by reviewing the workflow.
For details on the APIs you need to define for your connector and examples of how to use them, refer to the NetlifyConnector
API reference documentation.
Definitions
As you develop a connector, it might be helpful to review the following key terms:
- Data source: an external system or service that contains data, such as a content management system (CMS). Sometimes referred to as a content source.
- Data layer: in Netlify Connect, a data layer contains a real-time graph database with data synced from one or more data sources, and a GraphQL API to access that data. Netlify uses extensions to connect to data sources and sync data.
- Document model: a representation of the data that makes up an individual entity or document in your data source, such as a
Post
orUser
. Each document model includes various fields and each field has a type that references another defined model — such as a scalar, object, or union model. - GraphQL schema: defines the structure and data types that users can query using a data layer’s GraphQL API. Netlify generates the schema using the data model that your connector defines.
Workflow
When you develop the connector for your extension, you need to complete the following steps.
- Define your data model
- Define document models for your connector, including the related fields and types. You can also define cross-reference fields and types.
- Specify how to insert documents and process updates when syncing data to Netlify
- Define the configuration options that should appear in the Netlify UI when Connect users use your extension
- (Optional) Add support for localization
The above steps are for creating a static connector. For Connect, you also have the option to configure a dynamic connector instead.
Next steps
After you work through the above workflow to develop your connector, you can debug and test locally and then publish your connector to test in production.