graphql-sugar 0.1.2 → 0.1.3
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/CHANGELOG.md +6 -1
- data/lib/graphql/sugar/define/relationship.rb +6 -3
- data/lib/graphql/sugar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fb063cadbfd8e490a701b23d0a6fe7efbce9712
|
4
|
+
data.tar.gz: e2eb380c40825945afb4a889433eab7bcea5fa8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed5fc3820e397f25bda5a5687e82633e9c4f62bf9b23180628fd36db0794f777b37fd8b803b2ed8c5d1b9d0efbeed075eaf36c76e1e204c6a7e7b122881ec12a
|
7
|
+
data.tar.gz: 69e3fc34c0ce52277808a513085d97ab25a4a08239a9c304eec7832e2a91c8dde2aa6d6ee3d6c753593bd68985297012317ac9a3c48297f271b4e9f2bf165b95
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.1.3] - 2017-12-12
|
10
|
+
### Fixed
|
11
|
+
- Fix has_one relationship (#1)
|
12
|
+
|
9
13
|
## [0.1.2] - 2017-11-07
|
10
14
|
### Added
|
11
15
|
- This CHANGELOG file
|
@@ -21,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
21
25
|
### Added
|
22
26
|
- First release of this gem
|
23
27
|
|
24
|
-
[Unreleased]: https://github.com/keepworks/graphql-sugar/compare/v0.1.
|
28
|
+
[Unreleased]: https://github.com/keepworks/graphql-sugar/compare/v0.1.3...HEAD
|
29
|
+
[0.1.3]: https://github.com/keepworks/graphql-sugar/compare/v0.1.2...v0.1.3
|
25
30
|
[0.1.2]: https://github.com/keepworks/graphql-sugar/compare/v0.1.1...v0.1.2
|
26
31
|
[0.1.1]: https://github.com/keepworks/graphql-sugar/compare/v0.1.0...v0.1.1
|
@@ -11,7 +11,7 @@ module GraphQL
|
|
11
11
|
define_belongs_to(type_defn, field_name, model_class, association_name, association)
|
12
12
|
elsif association.association_class == ActiveRecord::Associations::HasOneAssociation ||
|
13
13
|
association.association_class == ActiveRecord::Associations::HasManyAssociation
|
14
|
-
|
14
|
+
define_has_one_or_many(type_defn, field_name, model_class, association_name, association)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -35,11 +35,14 @@ module GraphQL
|
|
35
35
|
GraphQL::Define::AssignObjectField.call(type_defn, field_name, type: type, property: property)
|
36
36
|
end
|
37
37
|
|
38
|
-
def self.
|
38
|
+
def self.define_has_one_or_many(type_defn, field_name, _model_class, association_name, association)
|
39
39
|
kwargs = {}
|
40
40
|
|
41
41
|
kwargs[:type] = "Types::#{association.klass}Type".constantize
|
42
|
-
|
42
|
+
|
43
|
+
if association.association_class == ActiveRecord::Associations::HasManyAssociation
|
44
|
+
kwargs[:type] = kwargs[:type].to_non_null_type.to_list_type
|
45
|
+
end
|
43
46
|
|
44
47
|
begin
|
45
48
|
function_class = Sugar.get_resolver_function(field_name)
|
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.
|
4
|
+
version: 0.1.3
|
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-
|
11
|
+
date: 2017-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|