graphql_grpc 0.1.11 → 0.1.12
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/graphql_grpc/schema.rb +10 -3
- data/lib/graphql_grpc/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ffeb0813752a6cb065f0e8d9a79d64522d56b94a7b520929eb8603846bc48d0
|
4
|
+
data.tar.gz: 6a95eb0206d3fd3f8bb2551c3c97887d6d80cf9fdfd1943acf7b9099511c4903
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37e05493be8484d21a22597fd5f84b5c1936148af58e26c9f5e5484a908783973936dfd88d8b2aef38660b4c2068455c7e859bb9f84c98a261cefabe80cc96f4
|
7
|
+
data.tar.gz: 5d98693707d835d078c71cab8c9ce7f36f992c9810c3d81c47594f3432f5a4974eac47bbe060e5d7709b684ef844c52cd99ccc7a12272bd18273e43e5da8eb17
|
data/lib/graphql_grpc/schema.rb
CHANGED
@@ -25,12 +25,13 @@ require 'google/protobuf/empty_pb'
|
|
25
25
|
module GraphqlGrpc
|
26
26
|
# :nodoc:
|
27
27
|
module Schema
|
28
|
+
QUERY_PREFIX_ENV_VAR = 'GRAPHQL_GRPC_QUERY_PREFIXES'
|
28
29
|
# TODO: Find better way to detect queries
|
29
30
|
# Currently look for methods named 'get', 'find' or with no args
|
30
31
|
def query?(name_sym, rpc_desc)
|
31
|
-
name_sym.to_s
|
32
|
-
|
33
|
-
|
32
|
+
name_str = name_sym.to_s
|
33
|
+
prefixes.each { |prefix| return true if name_str.start_with?(prefix) }
|
34
|
+
rpc_desc.rpc_desc.input == Google::Protobuf::Empty
|
34
35
|
end
|
35
36
|
|
36
37
|
def streaming_response?(rpc_desc)
|
@@ -96,5 +97,11 @@ module GraphqlGrpc
|
|
96
97
|
}
|
97
98
|
GRAPHQL_SCHEMA
|
98
99
|
end
|
100
|
+
|
101
|
+
private
|
102
|
+
|
103
|
+
def prefixes
|
104
|
+
@prefixes ||= (ENV[QUERY_PREFIX_ENV_VAR]&.strip&.split(',') || ['get', 'find'])
|
105
|
+
end
|
99
106
|
end
|
100
107
|
end
|
data/lib/graphql_grpc/version.rb
CHANGED
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
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zane Claes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-07-
|
12
|
+
date: 2019-07-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -213,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
213
|
- !ruby/object:Gem::Version
|
214
214
|
version: '0'
|
215
215
|
requirements: []
|
216
|
-
rubygems_version: 3.0.
|
216
|
+
rubygems_version: 3.0.3
|
217
217
|
signing_key:
|
218
218
|
specification_version: 4
|
219
219
|
summary: Gem for building GraphQL-to-gRPC gateways (usually using Ruby on Rails).
|