Skip to main content
Version: v3.x beta

Data Connectors

Introduction

A DataConnectorLink is a way to specify where your data comes from and how it can be used. It can connect to various types of data sources, like SQL databases, NoSQL databases, REST APIs, GraphQL APIs, files, and more.

The DataConnectorLink uses the ConnectorManifest it's associated with to introspect the respective data source and generate a schema that can be used to query and mutate the data.

Generate DataConnectorLink using the CLI

When you run the add connector-manifest command, the CLI generates a DataConnectorLink for you. Upon the connector's first build, the schema is introspected and the DataConnectorLink is updated with the schema according to the data source.

Metadata structure

Definition of a data connector, used to bring in sources of data and connect them to OpenDD models and commands.

KeyValueRequiredDescription
kindDataConnectorLinktrue
versionv1true
definitionDataConnectorLinkV1trueDefinition of a data connector - version 1.

Definition of a data connector - version 1.

KeyValueRequiredDescription
nameDataConnectorNametrueThe name of the data connector.
urlDataConnectorUrlReftrueThe url(s) to access the data connector.
headersHttpHeadersfalseKey value map of HTTP headers to be sent with each request to the data connector.
schemaSchemaAndCapabilitiesV01trueThe schema of the data connector. This schema is used as the source of truth when serving requests and the live schema of the data connector is not looked up.

Example:

name: data_connector
url:
singleUrl:
value: http://data_connector:8100
headers: {}
schema:
version: v0.1
schema:
scalar_types: {}
object_types: {}
collections: []
functions: []
procedures: []
capabilities:
version: 0.1.0
capabilities:
query:
variables: {}
mutation: {}

The schema of the data connector. This schema is used as the source of truth when serving requests and the live schema of the data connector is not looked up.

KeyValueRequiredDescription
versionv0.1true
schemaSchema Responsetrue
capabilitiesCapabilities Responsetrue

Key value map of HTTP headers to be sent with an HTTP request. The key is the header name and the value is a potential reference to an environment variable.

KeyValueRequiredDescription
<customKey>EnvironmentValuefalseEither a literal string or a reference to a Hasura secret

The url(s) to access the data connector.

One of the following values:

ValueDescription
DataConnectorUrlV1
Fn::ManifestRefRefer a ConnectorManifest to build and derive the connector URL from

Refer a ConnectorManifest to build and derive the connector URL from

KeyValueRequiredDescription
Fn::ManifestRefstringtrue

Must have exactly one of the following fields:

KeyValueRequiredDescription
singleUrlEnvironmentValuefalse
readWriteUrlsReadWriteUrlsfalse
KeyValueRequiredDescription
readEnvironmentValuetrue
writeEnvironmentValuetrue

Either a literal string or a reference to a Hasura secret

Must have exactly one of the following fields:

KeyValueRequiredDescription
valuestringfalse
valueFromEnvstringfalse

The name of a data connector.

Value: string

DataConnectorScalarRepresentation

The representation of a data connector scalar in terms of Open DD types

KeyValueRequiredDescription
kindDataConnectorScalarRepresentationtrue
versionv1true
definitionDataConnectorScalarRepresentationV1trueThe representation of a data connector scalar in terms of Open DD types

DataConnectorScalarRepresentationV1

The representation of a data connector scalar in terms of Open DD types

KeyValueRequiredDescription
dataConnectorNameDataConnectorNametrueThe name of the data connector that this scalar type comes from.
dataConnectorScalarTypestringtrueThe name of the scalar type coming from the data connector.
representationTypeNametrueThe name of the Open DD type that this data connector scalar type should be represented as.
graphqlDataConnectorScalarGraphQLConfiguration / nullfalseConfiguration for how this scalar's operators should appear in the GraphQL schema.

Example:

dataConnectorName: data_connector
dataConnectorScalarType: varchar
representation: String
graphql:
comparisonExpressionTypeName: String_Comparison_Exp

DataConnectorScalarGraphQLConfiguration

GraphQL configuration of a data connector scalar

KeyValueRequiredDescription
comparisonExpressionTypeNameGraphQlTypeName / nullfalse

GraphQlTypeName

Value: string

TypeName

The name of the Open DD type that this data connector scalar type should be represented as.

One of the following values:

ValueDescription
InbuiltTypeAn inbuilt primitive OpenDD type.
CustomTypeName

CustomTypeName

The name of a user-defined type.

Value: string

InbuiltType

An inbuilt primitive OpenDD type.

Value: ID / Int / Float / Boolean / String

DataConnectorName

The name of a data connector.

Value: string

Loading...