Module: Waveapps

Defined in:
lib/waveapps.rb

Defined Under Namespace

Classes: Error, Invoice

Constant Summary collapse

API_URL =
"https://gql.waveapps.com/graphql/public"
WAVEAPPS_TOKEN =
ENV.fetch('WAVEAPPS_TOKEN')
HTTP =
GraphQL::Client::HTTP.new(API_URL) do
  def headers(context)
    # Optionally set any HTTP headers
    {
    	"Authorization" => "Bearer #{WAVEAPPS_TOKEN}"
    }
  end
end
Schema =

However, it’s smart to dump this to a JSON file and load from disk

Run it from a script or rake task rake schema:dump

GraphQL::Client.load_schema("./tmp/schema.json")
Client =
GraphQL::Client.new(schema: Schema, execute: HTTP)