github-graphql-client 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d725e5fe7f5d2bc146fcafc9de560f950d422088
4
- data.tar.gz: cfe668cf9007d3a66ccc689979d2eb070bf26b3e
3
+ metadata.gz: d554cfa6de5c73673450deeb6c91fe0087c5dfb2
4
+ data.tar.gz: 02b76b3473807c6bcd4fb71433f948b8b64f3401
5
5
  SHA512:
6
- metadata.gz: 887ce5f481ecd255729efd6b90805b389081274f5e57e18aff5ed0d83071befbc57a54a32900ca61353a8c9c2cb97affe5c7c179c676a4284f50030c8e1ae9d6
7
- data.tar.gz: 919b69ef04baf78d7a723478563631055e34ce8317b375b4b12e71912aad71e782813fee7ae2bf9154936ff51181e178516ebe0f4f0453ff94195a681fe166f6
6
+ metadata.gz: ce152d2af3893e3dc7f9df152848e42fdad530ca8e45b8dc08f04f0f4be1f2fb8a41e0beaeb0c74865996d9442f4e8a2dbf6c4b288ca5b76a5fbdf12e15d8d33
7
+ data.tar.gz: 19da4af46033b38a22a5c04aa05d81597eba392d5242cfe92b6a812eff109eb95efc3a117fae3ed22a4fca502bfbd18454802489af09ffdec58fde950b84b63b
@@ -7,10 +7,19 @@ module GitHub
7
7
  URL = 'https://api.github.com/graphql'.freeze
8
8
 
9
9
  class Client
10
- def initialize(token: )
11
- http = ::GraphQL::Client::HTTP.new(GitHub::GraphQL::URL) do
12
- define_method :headers, ->(context) { context.merge({"Authorization" => "bearer #{token}"}) }
10
+ class HTTP < ::GraphQL::Client::HTTP
11
+ def initialize(token)
12
+ @token = token
13
+ super(GitHub::GraphQL::URL)
14
+ end
15
+
16
+ def headers(context)
17
+ context.merge({"Authorization" => "bearer #{@token}"})
13
18
  end
19
+ end
20
+
21
+ def initialize(token: )
22
+ http = ::GitHub::GraphQL::Client::HTTP.new(token)
14
23
  schema = ::GraphQL::Client.load_schema(http)
15
24
 
16
25
  @client = ::GraphQL::Client.new(schema: schema, execute: http)
@@ -1,7 +1,7 @@
1
1
  module GitHub
2
2
  module GraphQL
3
3
  class Client
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-graphql-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - takkanm
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-05 00:00:00.000000000 Z
11
+ date: 2017-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql-client