proxySchema
For use with Netlify Connect only.
connector.proxySchema(fn)
Used to define and build a dynamic connector that builds a GraphQL schema using @graphql-tools
modules.
Takes a function with an object as a parameter. The object contains the following properties:
Parameter | Description |
---|---|
getRemoteGraphQLSchema | Function for creating a dynamic API from an existing GraphQL endpoint. |
options | Object that contains the configuration values set for options defined using defineOptions in addConnector . |
state | Object that contains data stored in initState when addConnector runs. |
typePrefix | String that represents a prefix to add all GraphQL types from that data source. |
You can use proxySchema()
in place of model()
and sync()
to build a dynamic-only connector, or you can include all of these methods and build a connector that supports a data source that is both static and dynamic.
Learn more about building a dynamic connector.
getRemoteGraphQLSchema
Function that allows you to create a dynamic API from an existing GraphQL endpoint.
Takes an object with the following parameters:
Parameter | Description |
---|---|
headers | Headers required to access the schema from your GraphQL endpoint. For example, authentication headers. |
url | URI for your GraphQL endpoint. |