changes
This commit is contained in:
parent
6a258db47f
commit
beaf92f7c4
22 changed files with 773 additions and 238 deletions
16
lib/ezcontainer_railway/graphql_client.ex
Normal file
16
lib/ezcontainer_railway/graphql_client.ex
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
defmodule EzcontainerRailway.GraphqlClient do
|
||||
@graphql_url "https://backboard.railway.app/graphql/v2"
|
||||
@token "98237cc5-d503-4514-bb59-984d3403afe6"
|
||||
|
||||
def query(query, opts) when is_binary(query) and is_list(opts) do
|
||||
body = %{
|
||||
"query" => query,
|
||||
"variables" => opts[:variables]
|
||||
}
|
||||
|
||||
case Req.Request.put_headers(Req.new(), [{"Authorization", "Bearer #{opts[:token]}"}]) |> Req.post(url: @graphql_url, json: body) do
|
||||
{:ok, resp} -> resp
|
||||
{:error, _} -> :error
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue