waveapps 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1279fc5cb143e469c2bedd1439933d9dc4d1ba6de28bcfbcac523afa64e91e4
4
- data.tar.gz: 3560ecf5968f58c3eccbc3d12b7e9166395b5158ddac48556b2dee86a362cebd
3
+ metadata.gz: f11120a5bb89d6849743ed909fce7f7f131343001281c369eb99db4c2e5d936c
4
+ data.tar.gz: 74fd04b8dfda4ae34fa48f5a33ef609085971c71bc3b7b3bc87c76218108ca2d
5
5
  SHA512:
6
- metadata.gz: f5cb7ce7a7d2ba53a6986b107ba1f6cf4b0c5f80fed6a397b889e7457a49f42101dace5bbcd9447fd357a4b1e45591b905a83879d70bf11598b9011f3c9dce1a
7
- data.tar.gz: d72350a0b5c1e33ca3ff09335554c5a7e0ef2778b63aef7f271de7c10c649cdedc105f3e08547e6a6c87d0e4094fd040ebfd59926c13d3ecd0194e5795c882be
6
+ metadata.gz: 834d60888c9e5e3cd4ca879edc9d3151882a586c16323a0261663c93d655fb60b046a1793488e63656089f4a66616b125a3c64b4a610b88b8e531298f6a9c194
7
+ data.tar.gz: c4129c8d9e03354d79b369037f668fbc5da9b2365ebdb61b9f4db2182ca9fc95e9ec4e7b42f2bfb45fc234a07a913329c63679099038c2e9988ab886b6c2aec3
@@ -0,0 +1,19 @@
1
+ require "graphql/client"
2
+ require "graphql/client/http"
3
+
4
+ API_URL = "https://gql.waveapps.com/graphql/public"
5
+ WAVEAPPS_TOKEN = ENV.fetch('WAVEAPPS_TOKEN')
6
+ HTTP = GraphQL::Client::HTTP.new(API_URL) do
7
+ def headers(context)
8
+ # Optionally set any HTTP headers
9
+ {
10
+ "Authorization" => "Bearer #{WAVEAPPS_TOKEN}"
11
+ }
12
+ end
13
+ end
14
+ namespace :schema do
15
+ desc "Dumps GraphQL Schema so that you don't have to make http requests every time"
16
+ task :dump do
17
+ GraphQL::Client.dump_schema(HTTP, "./tmp/schema.json")
18
+ end
19
+ end
data/lib/waveapps.rb CHANGED
@@ -17,14 +17,14 @@ module Waveapps
17
17
  end
18
18
 
19
19
  # Fetch latest schema on init, this will make a network request
20
- # Schema = GraphQL::Client.load_schema(HTTP)
20
+ Schema = GraphQL::Client.load_schema(HTTP)
21
21
 
22
22
  # However, it's smart to dump this to a JSON file and load from disk
23
23
  #
24
24
  # Run it from a script or rake task
25
25
  # rake schema:dump
26
26
  #
27
- Schema = GraphQL::Client.load_schema("./tmp/schema.json")
27
+ # Schema = GraphQL::Client.load_schema("./tmp/schema.json")
28
28
 
29
29
  Client = GraphQL::Client.new(schema: Schema, execute: HTTP)
30
30
 
@@ -1,5 +1,5 @@
1
1
  module Waveapps
2
2
  module Ruby
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: waveapps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hannah Masila
@@ -74,6 +74,7 @@ extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
76
  - Rakefile
77
+ - lib/tasks/schema.rake
77
78
  - lib/waveapps.rb
78
79
  - lib/waveapps/ruby/version.rb
79
80
  homepage: https://github.com/metaware/waveapps-ruby