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 +4 -4
- data/lib/tasks/schema.rake +19 -0
- data/lib/waveapps.rb +2 -2
- data/lib/waveapps/ruby/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f11120a5bb89d6849743ed909fce7f7f131343001281c369eb99db4c2e5d936c
|
4
|
+
data.tar.gz: 74fd04b8dfda4ae34fa48f5a33ef609085971c71bc3b7b3bc87c76218108ca2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
|
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.
|
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
|