rails-graphql 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
  SHA256:
3
- metadata.gz: 49e43687d5292b789a8bd31a328c7788e65ea18fa9e7210804a6d2b5fa626a55
4
- data.tar.gz: e18c7462267165fbc6c891cb6abcd8e1d58a7c4e4cef52209d8b7cd779775768
3
+ metadata.gz: 0f89afed32f0e7c1c9738f6fc92f99cd25b985f18b830c02e85cf7ba622486b7
4
+ data.tar.gz: 2b478c122302b2a8f1e7cf386fb2545b1a7665d5745c4e78708541c913ff7d70
5
5
  SHA512:
6
- metadata.gz: 9a389ad749b2de6f1109b81e675ab78adad048b2d621e268c2d22a7ed7ace9f76aa2ab7b82510a2089cdced461f3df721a89f3a86a9c4fca5215458266b274c3
7
- data.tar.gz: ac5b71676b2bded14527eed7d2b2b7242c3258f9ee0aaddc562d9ea7a58931aa1372d54634176058e0e1f4b959c712db95831dbcd2b1f15473652b13aa8126aa
6
+ metadata.gz: 6996ae2c2d05697dc923a78eec06a236e7199fe7cbf0e459bf9444792caff76fec3442e0f6006581e2cd49e8ca9d95f0b2d4476ddd57264b274b90db51b5ab62
7
+ data.tar.gz: 1c885af10dc5187e478ed8887f2b98522ab7ffccb1ff8788a4dbc7d751d78b2560232ac74c6ae89e8c9b47e21021b5b1a5475de5ebdef38c3a5a9604dbaeada1
@@ -24,8 +24,8 @@ module Rails # :nodoc:
24
24
  # Get the performer that can be already defined or used through the
25
25
  # +method_name+ if that is callable
26
26
  def performer
27
- @performer ||= callable?(method_name) \
28
- ? Callback.new(self, :perform, method_name) \
27
+ @performer ||= callable?(:"#{method_name}!") \
28
+ ? Callback.new(self, :perform, :"#{method_name}!") \
29
29
  : false
30
30
  end
31
31
 
@@ -44,9 +44,9 @@ module Rails # :nodoc:
44
44
 
45
45
  item['path'] = path if path.present? && path.is_a?(Array)
46
46
  item['extensions'] = extra.deep_stringify_keys if extra.present?
47
- item['locations'].map!(&:stringify_keys)
47
+ item['locations']&.map!(&:stringify_keys)
48
48
 
49
- @items << item
49
+ @items << item.compact
50
50
  end
51
51
  end
52
52
  end
@@ -145,6 +145,11 @@ module Rails # :nodoc:
145
145
  defined?(@built) && !!@built
146
146
  end
147
147
 
148
+ # Checks if a given method can act as resolver
149
+ def gql_resolver?(method_name)
150
+ (instance_methods - GraphQL::Source.instance_methods).include?(method_name)
151
+ end
152
+
148
153
  # Attach all defined schema fields into the schemas using the namespaces
149
154
  # configured for the source
150
155
  def attach_fields!
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rails # :nodoc:
4
4
  module GraphQL # :nodoc:
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-graphql
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
  - Carlos Silva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-06 00:00:00.000000000 Z
11
+ date: 2020-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails