graphql_grpc 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: 73ffb6b8a88a45dfc882b15a467c1c5912740e69a0d85502935853c32f415ac6
4
- data.tar.gz: ddcca9cf940118b08e7be88c105a92025f55cfaca273b2f8b434ab8a5be747d0
3
+ metadata.gz: 86651ef5d4cf1df930ce2ad7969ec8a1efa4bb58df4a0ad52d87d70ebcfa3181
4
+ data.tar.gz: 07103b09212d3a89c6c0b13e925d9f28aca57ce752b1fd5bc7de554e04767c93
5
5
  SHA512:
6
- metadata.gz: e79abd3330bae88e762862dc67260d11214479c1d0d21d64d06b8ecdbd3b4a64e3e49b81b42965b7c590d89409ff63c311329efa86d0f120f39781d6aab4d21e
7
- data.tar.gz: f4053cc79dd3c07add87c51dfd5a81773c7716a178afaba58d47c725e9dfe0b12e2b8ed7e8839bde164f321a60e6e7c54ae09dd30d165fa1906ba189382c84a5
6
+ metadata.gz: ba420a9f79fe8fd4bd56810355d69a9b3f5ff58b62582b820b142dc6097703a98c7701677325042ee0c236a71a3324976b8c885bb3384877abd160b82077deb8
7
+ data.tar.gz: 7126155980b0526133ef7d26db9e10851fb7ed28c9870f32a9ddae562fe0a8d38e6ca6ba70ee339e8650e5fdf50e7c1585e06fd3c2ddbccd1d67b41afd55b4f3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql_grpc (0.1.4)
4
+ graphql_grpc (0.1.5)
5
5
  activesupport
6
6
  graphql
7
7
  grpc
@@ -20,7 +20,7 @@ GEM
20
20
  bombshell (0.1.6)
21
21
  byebug (10.0.2)
22
22
  coderay (1.1.2)
23
- concurrent-ruby (1.1.3)
23
+ concurrent-ruby (1.1.4)
24
24
  diff-lcs (1.3)
25
25
  faraday (0.15.3)
26
26
  multipart-post (>= 1.2, < 3)
@@ -59,7 +59,7 @@ GEM
59
59
  guard (~> 2.1)
60
60
  guard-compat (~> 1.1)
61
61
  rspec (>= 2.99.0, < 4.0)
62
- i18n (1.1.1)
62
+ i18n (1.3.0)
63
63
  concurrent-ruby (~> 1.0)
64
64
  jaro_winkler (1.5.1)
65
65
  json-schema (2.8.1)
@@ -0,0 +1,17 @@
1
+ module GraphqlGrpc
2
+ class Resolver
3
+ def initialize(proxy)
4
+ @proxy = proxy
5
+ end
6
+
7
+ attr_reader :proxy
8
+
9
+ def call(_type, field, obj, args, ctx)
10
+ if obj
11
+ value = obj[field.name.to_sym]
12
+ return value.is_a?(Symbol) ? value.to_s : value
13
+ end
14
+ proxy.invoke(field, args, ctx)
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module GraphqlGrpc
2
- VERSION = '0.1.4'.freeze
2
+ VERSION = '0.1.5'.freeze
3
3
  end
data/lib/graphql_grpc.rb CHANGED
@@ -2,6 +2,7 @@ require 'grpc'
2
2
  require 'graphql_grpc/version'
3
3
  require 'graphql_grpc/arrayify'
4
4
  require 'graphql_grpc/function'
5
+ require 'graphql_grpc/resolver'
5
6
  require 'graphql_grpc/schema'
6
7
  require 'graphql_grpc/proxy'
7
8
  require 'graphql_grpc/type_library'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql_grpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zane Claes
@@ -190,6 +190,7 @@ files:
190
190
  - lib/graphql_grpc/arrayify.rb
191
191
  - lib/graphql_grpc/function.rb
192
192
  - lib/graphql_grpc/proxy.rb
193
+ - lib/graphql_grpc/resolver.rb
193
194
  - lib/graphql_grpc/schema.rb
194
195
  - lib/graphql_grpc/type_library.rb
195
196
  - lib/graphql_grpc/version.rb