graphql_rails 0.3.1 → 0.3.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
  SHA256:
3
- metadata.gz: 37d3a8bef6d9bc2d8aa9588b82f545691850873986145c06d275430aa914bf0d
4
- data.tar.gz: 9abf27f97be2c8a7c58d2c9d10a2cc9adfc6e020aba1ba8152c02732f6e282c7
3
+ metadata.gz: 6960308081875563c429085033503f5f6eb4f5078eb610c0a96e95edb4879e6f
4
+ data.tar.gz: 84b19c7d4811f988ba4caf14eee6f3beb04b460ed92fc39b2d428ef219b44d38
5
5
  SHA512:
6
- metadata.gz: 58b379e8c492e287a44d3b1f0802566dc222c67744b5ecf4560240c77680b209224e320025c6a56eb5fe218e3a20b6734747b04aed7ef1bd403229ee7cde1602
7
- data.tar.gz: 52a947aab1faf8b8cf1249527ede28dfd58e0c4f5dcb080e6c1c621bbd09372b47202b3cea8a18883a83fbdea5462204b49cb7a12bbf7db398d9bc0e3f78e04e
6
+ metadata.gz: 36cc14d59e7df9f050844e9406596d69bbf97411ec192d1081b630277dc1de5f18706006f5c41072ccc1983aa23d2638d4a96fb7ed10ec7955e5ed0acee28bdc
7
+ data.tar.gz: 9136375cc875cd7db7d29fd7aac2507cca4364f1504432d7328d629b86e795422a2a48239ea1d98915d3217c7f355c74aa598d9133dc49277dda2cb78fdeb3dc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql_rails (0.3.1)
4
+ graphql_rails (0.3.2)
5
5
  activesupport (>= 4)
6
6
  graphql (~> 1)
7
7
 
@@ -29,7 +29,7 @@ GEM
29
29
  concurrent-ruby (1.0.5)
30
30
  diff-lcs (1.3)
31
31
  docile (1.3.0)
32
- graphql (1.8.2)
32
+ graphql (1.8.4)
33
33
  i18n (1.0.1)
34
34
  concurrent-ruby (~> 1.0)
35
35
  json (2.1.0)
@@ -65,18 +65,12 @@ module GraphqlRails
65
65
 
66
66
  def default_collection_type
67
67
  if action_config.paginated?
68
- default_connection_type
68
+ action_model.graphql.connection_type
69
69
  else
70
70
  default_inner_return_type.to_list_type.to_non_null_type
71
71
  end
72
72
  end
73
73
 
74
- def default_connection_type
75
- model_graphql_type.define_connection do
76
- field :total, types.Int, resolve: ->(obj, _args, _ctx) { obj.nodes.size }
77
- end
78
- end
79
-
80
74
  def action_relative_path
81
75
  route.relative_path
82
76
  end
@@ -39,6 +39,14 @@ module GraphqlRails
39
39
  ).call
40
40
  end
41
41
 
42
+ def connection_type
43
+ @connection_type ||= begin
44
+ graphql_type.define_connection do
45
+ field :total, types.Int, resolve: ->(obj, _args, _ctx) { obj.nodes.size }
46
+ end
47
+ end
48
+ end
49
+
42
50
  private
43
51
 
44
52
  attr_reader :model_class
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphqlRails
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Povilas Jurčys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-14 00:00:00.000000000 Z
11
+ date: 2018-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql