OASGraph can be used either as a library, or via its Command Line Interface (CLI) to quickly get started. To install the OASGraph CLI, simply run the indicated command.
$npm i -g oasgraph-cli
OASGraph relies on the OpenAPI Specification (OAS) of an existing API to create a GraphQL interface around that API.
If you use LoopBack, start your API server in the LoopBack project folder, and access the API's OAS at http://127.0.0.1:3000/openapi.json. Save the OAS to disk.
# in the LoopBack project folder:
If you want to generate a GraphQL interface for another API, make sure that API is running and save its OAS.
Once OASGraph is installed and the OAS is obtained, you can create and start the GraphQL server from the folder in which OASGraph is installed. The created GraphQL server is then accessible at http://127.0.0.1:3001/graphql.
# in the OASGraph folder:
$oasgraph [path to saved OAS]