fragment-alpha-sdk 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fragment_client.rb +6 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b81f5fea84ed3e77c2959d892d5e552f2787d57f02c335c46140fbec386864f2
4
- data.tar.gz: 845b6448907c7903895ba5e089ec0d0883d3d708e42945b49ec4c10727374d09
3
+ metadata.gz: 9cf03179626f6c1922a1ee0f77cd7a04ede4d909ca21e54fb40b32d0bb0dca86
4
+ data.tar.gz: 25c7dd03d7dffaa64097c437489aef3db649641fc41e27f150f0b0ff7ab82e6f
5
5
  SHA512:
6
- metadata.gz: 44d8a92445b994bc075cb80b3f1da7766d23e558cbbfc7198e698b7613b1f40f9efd26439dde74e14dd61e22832a3cc98d0d0e4dadf07a6488298e02c3cc51e2
7
- data.tar.gz: 70944928d008ef18413bffccae0f44049d695f55421c545f1bcb1720e384f3aa4c918f08d09f51a325ad5a57a0329f44941642b1d7b032f4a8dde2b72af5e348
6
+ metadata.gz: 65d2f4e9deba146534d24d3d8b2ecad0f2c92231c6a54e098bc1e595c5da4fee41140dfe1252e24e683b6e6de647c09e933a9561f448c7a53baa70869313d0b7
7
+ data.tar.gz: 9b1d95a0e3639930974482a6cdc7fa01822415db8a6103f2928e5394e2a68ff791a10bea6593d886969724850c46f12f517c35f52f4053353068a6a5bc8e968d
@@ -7,13 +7,13 @@ require 'json'
7
7
  require 'graphql/client'
8
8
  require 'graphql/client/http'
9
9
  require 'sorbet-runtime'
10
- require 'pry'
11
10
 
11
+ # A support module for the client
12
12
  module FragmentGraphQl
13
13
  extend T::Sig
14
14
  http = GraphQL::Client.const_get(:HTTP).new('https://api.fragment.dev/graphql') do
15
15
  extend T::Sig
16
- sig {params(context: T.untyped).returns(T::Hash[T.untyped, T.untyped])}
16
+ sig { params(context: T.untyped).returns(T::Hash[T.untyped, T.untyped]) }
17
17
  def headers(context)
18
18
  { 'Authorization' => 'Bearer %s' % context[:access_token] }
19
19
  end
@@ -21,14 +21,11 @@ module FragmentGraphQl
21
21
 
22
22
  Schema = T.let(GraphQL::Client.load_schema("#{__dir__}/fragment.schema.json"), T.untyped)
23
23
 
24
- puts File.read("#{__dir__}/fragment.schema.json")
25
- pry
26
-
27
- Client = T.let(GraphQL::Client.new(schema: Schema, execute: RDoc::Attr), GraphQL::Client)
24
+ Client = T.let(GraphQL::Client.new(schema: Schema, execute: http), GraphQL::Client)
28
25
 
29
26
  Queries = T.let(Client.parse(
30
- File.open("#{__dir__}/queries.graphql").read
31
- ), T.untyped)
27
+ File.open("#{__dir__}/queries.graphql").read
28
+ ), T.untyped)
32
29
  end
33
30
 
34
31
  # A client for Fragment
@@ -53,7 +50,7 @@ class FragmentClient
53
50
  end
54
51
  end
55
52
 
56
- sig {params(query: T.untyped, variables: T.untyped).returns(T.untyped)}
53
+ sig { params(query: T.untyped, variables: T.untyped).returns(T.untyped) }
57
54
  def query(query, variables)
58
55
  FragmentGraphQl::Client.query(query, variables: variables, context: { access_token: @token })
59
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fragment-alpha-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - fragment