graphql-active_record 0.3.1 → 1.0.0

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: 5a44cf0f25abe8f851f4a3801183c97f8b03c0cd
4
- data.tar.gz: 17f9a15ed51efc2b299419cbbbbf8a6f0c96c58f
3
+ metadata.gz: 45115b2145e11a13330473d364a94790d919e3ea
4
+ data.tar.gz: e52d540737421aa06ac82a6b7b87ae7fa8519268
5
5
  SHA512:
6
- metadata.gz: 50ec563ed10c4ddbbae8b98326cbf6617f101705423ce70113839b1dfcdaf6d188b8a2b1db9b4afe21d13b41d6261e84e594e1aae1bacec07bb7caf65beea1b4
7
- data.tar.gz: 09260d87f51cce3ec84fec7e39d5b6f4bce1e40ad20e62869e57cadfb6160060df4a11c00a43446828bb969fbfd12c59e5e1336b37f8f55bc74576df99a9208c
6
+ metadata.gz: 6451c770f4f7d385259fae307deb0e294b69ba8a8f931bf1a735f04c34f4f63498bdc05ef54c7aa1756b0d80d3d4fdf2c6bea69ef7df7fae8b6282d6dda703c8
7
+ data.tar.gz: 5cdb683ecb4891d1d0abc625cab9514d0b15fe18bb82d14fb42512e2d26fdcd653c8ccc160e8cf169ba01647b72fd9448b9c2617df662b81ae804410a19afcdb
data/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ # version 1.0.0
2
+ Move uuid to an argument instead [#1](https://github.com/brettjurgens/graphql-active-record/pull/1)
data/README.md CHANGED
@@ -26,9 +26,6 @@ Use like:
26
26
 
27
27
  ```ruby
28
28
  GraphQL::ActiveRecordExtensions::Field.new(type: Type, model: Model)
29
-
30
- # using UUID
31
- GraphQL::ActiveRecordExtensions::Field.new(type: Type, model: Model, use_uuid: true)
32
29
  ```
33
30
 
34
31
  ## Development
@@ -5,9 +5,8 @@
5
5
  module GraphQL
6
6
  module ActiveRecordExtensions
7
7
  class Field < ::GraphQL::Field
8
- def initialize(model:, type:, use_uuid: false)
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 @use_uuid
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'])
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module ActiveRecordExtensions
3
- VERSION = "0.3.1"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
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.3.1
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-03-29 00:00:00.000000000 Z
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