GraphQL
The GraphQL connector allows you to merge remote GraphQL APIs with your existing project API using the Edge Gateway.
name
(required) — The unique name for connectornamespace
(optional,true
by default) — Enable or disable the namespaceurl
— The URL used to execute requests and introspectionheaders
(optional) — The static or forwarded headers sent with requests
import { config, connector, g } from '@grafbase/sdk'
const contentful = connector.GraphQL('Contentful', {
url: g.env('CONTENTFUL_API_URL'),
headers: headers => {
headers.set('Authorization', `Bearer ${g.env('CONTENTFUL_API_KEY')}`)
},
})
g.datasource(contentful)