alpha-cli provides a curl-like CLI wrapper around the
alpha client. This
allows Lambda services to be directly invoked manually.
$ npm install -g @lifeomic/alpha-cli
Use for services like OpenSearch when set up with Role based auth.
When combined with the
--proxy option normal RESTful UI tools can then
be used to hit a cluster without additional configuration.
Interacting with GraphQL lambdas using the Alpha CLI proxy
This is a guide on how to proxy GraphQL requests through
Alpha in order to be able
to use IDEs to construct and execute queries. While this approach is IDE
agnostic, this will demonstrate how to proxy to the Insomnia IDE,
offering capabilities like automatic schema detection, auto-complete, linting,
and a convenient way to save queries.
Install a GraphQL IDE
Insomnia has a nice interface, but [Postman] and other IDEs should work as well.
brew install --cask insomnia
You'll need to be authenticated against your AWS environment
# Connect to the proxy alpha --proxy lambda://my-graphql-lambda:deployed
Once you're logged in and your proxy is running, launch Insomnia and start creating/organizing queries. It may be convenient to organize them by folder.
For a typical GraphQL request, you'll want to configure your request to
POST to http://localhost:[port],
You'll also likely need to configure headers. If using lifeomic APIs, you may need
on the service:
Depending on how you've configured Insomnia, it will either automatically start fetching the schema, or you can manually fetch it.
Once you've successfully loaded the schema, you can pull up documentation using the same dialog, allowing you to click through and copy GraphQL queries/mutations.
Now that the schema is loaded, you can review documentation and create and test queries with autocomplete