Super Graph can be used as a library in an already existing project. The best part is that your API need not even be a GraphQL one. You can simply use Super Graph as an alternative to a GO ORM library or directly writing SQL. The following code is just a simple example:
The configuration is the same as that in yaml except for that it is obviously written in Go and is just about configuring the
core package (aka Super Graph library). We've tried to ensure that the config file is self-documenting and easy to work with. A config object is not required Super Graph can learn your database structure and be useful even when a config is not provided.
If you're using a Postgres schema other than the default
public then in addition to setting the
DBSchema config param you also have to set the
search_path runtime parameter on the DB connection itself. https://github.com/dosco/super-graph/issues/134#issuecomment-659562003