proxySchema
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 |
---|---|
options | Object that contains the configuration values set for options defined using defineOptions() . |
state | Object that contains data stored during init() . |
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.
Usage example
For more details and the full example, refer to this combined static and dynamic connector example repository.