graphql-sugar 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10dcb385728916c69a4b47a63240a46fe15f3b37
4
- data.tar.gz: ac26eacd443a5624f94ca8b088c5448ff6cb07c1
3
+ metadata.gz: f562a7bc8a52945758affa95258afcf30cf1ccc9
4
+ data.tar.gz: 2de8c9edece7f4d8d1290cc4f81bfe1a35c4aa09
5
5
  SHA512:
6
- metadata.gz: b4c3b112e3d4bec644818dc65ad2477fdd3b3a75c50b8edc42f24c3557dee29ea47557c92be97d256cf6887316957e41dc27a9fefe957de89fa828dc9d9baeec
7
- data.tar.gz: fdb71bfaf2a1b200bd732a93e9bebaef4a137412ea3949c68517631f67a06007cad4bc2d6794236f3233eb6e34717cd727f21b8d1edf1f0496ae607476d6f343
6
+ metadata.gz: e5719b575b8dc6da9b12c9c91ce0d353dc6e1289f3d5e10ba67a93e00508dd0fdd9c6cddb2b540e73be330211c2b54f97cd23b588dce10d8ba602d506b866b7f
7
+ data.tar.gz: 5b53bee24e49699dd5de555cbea641997e23ff3c4dbce0e39b65dda1c7f7071381200f01aebaa606d1594ef2ad7884fff2e5365cd5cbcc0d83f550210bf0b4f6
data/CHANGELOG.md ADDED
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.2] - 2017-11-07
10
+ ### Added
11
+ - This CHANGELOG file
12
+
13
+ ### Fixed
14
+ - Allow resolver type to be overridden correctly
15
+
16
+ ## [0.1.1] - 2017-10-25
17
+ ### Changed
18
+ - Improve README
19
+
20
+ ## 0.1.0 - 2017-10-25
21
+ ### Added
22
+ - First release of this gem
23
+
24
+ [Unreleased]: https://github.com/keepworks/graphql-sugar/compare/v0.1.2...HEAD
25
+ [0.1.2]: https://github.com/keepworks/graphql-sugar/compare/v0.1.1...v0.1.2
26
+ [0.1.1]: https://github.com/keepworks/graphql-sugar/compare/v0.1.0...v0.1.1
@@ -3,14 +3,17 @@ module GraphQL
3
3
  module Define
4
4
  module Resolver
5
5
  def self.call(type_defn, field_name, type_or_field = nil, desc = nil, **kwargs, &block) # rubocop:disable Metrics/ParameterLists
6
- # Automatically determine type
7
6
  type_or_field ||= kwargs[:type] if !kwargs[:type].nil?
8
- type_or_field ||= Sugar.get_resolver_graphql_type(field_name)
9
7
 
10
- # Automatically determine if plural, modify type to !types[Type] if true
11
- plural = kwargs[:plural]
12
- plural = Sugar.get_resolver_plural(field_name) if plural.nil?
13
- type_or_field = type_or_field.to_list_type.to_non_null_type if plural
8
+ if type_or_field.nil?
9
+ # Automatically determine type
10
+ type_or_field ||= Sugar.get_resolver_graphql_type(field_name)
11
+
12
+ # Automatically determine if plural, modify type to !types[Type] if true
13
+ plural = kwargs[:plural]
14
+ plural = Sugar.get_resolver_plural(field_name) if plural.nil?
15
+ type_or_field = type_or_field.to_list_type.to_non_null_type if plural
16
+ end
14
17
 
15
18
  # Automatically determine function
16
19
  function_class = Sugar.get_resolver_function(field_name)
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Sugar
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-sugar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pradeep Kumar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-25 00:00:00.000000000 Z
11
+ date: 2017-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -62,6 +62,7 @@ files:
62
62
  - ".gitignore"
63
63
  - ".rspec"
64
64
  - ".travis.yml"
65
+ - CHANGELOG.md
65
66
  - CODE_OF_CONDUCT.md
66
67
  - Gemfile
67
68
  - LICENSE.txt