A Livebook Smart Cell designed to run GraphQL queries
Built on AbsintheClient
, this project provides two cells:
- Client cell
- Query cell
The client cell uses AbsintheClient
to build a Req
struct with the proper credentials necessary to hit a GraphQL API. We use rickandmortyapi.com in our examples.
The query cell takes the output of the client cell and runs the query.
If available in Hex, the package can be installed
by adding graphql_smart_cell
to your list of dependencies in mix.exs
:
def deps do
[
{:graphql_smart_cell, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/graphql_smart_cell.
Run mix docs && open docs/index.html
, then use the Run in Livebook button.
Ultimately we came very close to shipping the following integration with GraphiQL– Consider this a cautionary tale in relying on JavaScript!
This project was based on and uses some code from the KinoDB project, Apache-2.0 License.