graphql-active_record 0.3.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +0 -3
- data/lib/graphql/active_record_extensions/field.rb +7 -4
- data/lib/graphql/active_record_extensions/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45115b2145e11a13330473d364a94790d919e3ea
|
4
|
+
data.tar.gz: e52d540737421aa06ac82a6b7b87ae7fa8519268
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6451c770f4f7d385259fae307deb0e294b69ba8a8f931bf1a735f04c34f4f63498bdc05ef54c7aa1756b0d80d3d4fdf2c6bea69ef7df7fae8b6282d6dda703c8
|
7
|
+
data.tar.gz: 5cdb683ecb4891d1d0abc625cab9514d0b15fe18bb82d14fb42512e2d26fdcd653c8ccc160e8cf169ba01647b72fd9448b9c2617df662b81ae804410a19afcdb
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -5,9 +5,8 @@
|
|
5
5
|
module GraphQL
|
6
6
|
module ActiveRecordExtensions
|
7
7
|
class Field < ::GraphQL::Field
|
8
|
-
def initialize(model:, type
|
8
|
+
def initialize(model:, type:)
|
9
9
|
@model = model
|
10
|
-
@use_uuid = use_uuid
|
11
10
|
|
12
11
|
self.type = type
|
13
12
|
self.description = "Find a #{model.name} by ID"
|
@@ -15,7 +14,11 @@ module GraphQL
|
|
15
14
|
'id' => GraphQL::Argument.define do
|
16
15
|
type !GraphQL::ID_TYPE
|
17
16
|
description "Id for record"
|
18
|
-
end
|
17
|
+
end,
|
18
|
+
'use_uuid' => GraphQL::Argument.define do
|
19
|
+
type GraphQL::BOOLEAN_TYPE
|
20
|
+
description "Whether or not to use UUID"
|
21
|
+
end,
|
19
22
|
}
|
20
23
|
end
|
21
24
|
|
@@ -34,7 +37,7 @@ module GraphQL
|
|
34
37
|
|
35
38
|
model_with_includes = include_in_model(@model, includes)
|
36
39
|
|
37
|
-
if
|
40
|
+
if arguments['use_uuid']
|
38
41
|
model_with_includes.find_by_uuid(arguments['id'])
|
39
42
|
else
|
40
43
|
model_with_includes.find(arguments['id'])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-active_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Jurgens
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -189,6 +189,7 @@ files:
|
|
189
189
|
- ".rspec"
|
190
190
|
- ".travis.yml"
|
191
191
|
- Appraisals
|
192
|
+
- CHANGELOG.md
|
192
193
|
- Gemfile
|
193
194
|
- Guardfile
|
194
195
|
- LICENSE.txt
|