ArangoXEcto.api_query
You're seeing just the function
api_query
, go back to ArangoXEcto module for more information.
Specs
api_query(mod(), atom(), list()) :: {:ok, Arangox.Response.t()} | {:error, any()}
Runs an Arangox function using a repo
This is simply a helper function that extracts the connection from the repo and runs a regular query.
Parameters
repo
- The Ecto repo module used for connectionfunction
- An atom of the Arangox function to runargs
- The options passed to the function (not including the conn argument)
The conn
argument is automatically prepended to your supplied args
Supported Functions
:abort
:cursor
:delete
:delete!
:get
:get!
:head
:head!
:options
:options!
:patch
:patch!
:post
:post!
:put
:put!
:request
:request!
:run
:status
:transaction
(use built inEcto.Repo.transaction/2
instead)
Examples
iex> ArangoXEcto.api_query(Repo, :get, ["/_api/collection"])
{:ok, %Arangox.Response{body: ...}}
iex> ArangoXEcto.api_query(Repo, :non_existent, ["/_api/collection"])
** (ArgumentError) Invalid function passed to `Arangox` module