graphql-kaminari_connection 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da87b778be603c1ddd5e6774b70ec8922a62a37785c040be4172e1ff2314eab2
4
- data.tar.gz: eb86004f00f5c7c3c37ce4e7aa1be07fff166effb820a6144c1ffe9500e3eac3
3
+ metadata.gz: 2b5be78fc8774cc0f713eadd085dd2cdbe8fd6eb0b9a0d32abd9c4d4022a3cd1
4
+ data.tar.gz: e1b10709b0a806691d4c076f5f79cb31b2a73ac1f56136d8057988e282814382
5
5
  SHA512:
6
- metadata.gz: 7ac8beb874ab25fddf4a6e203ddeaf12a14b5b88811aa78ba3d616673aaceaf9c199c3172958cdc24098c97ab598f3f67c8858b27e9b9cb209b0040d4926a475
7
- data.tar.gz: b2c869791754da3d10a5a448910895537f1970f2657401c9cda082466adee03b613973171646b6ce5aca5492e5c7c5545b784480331f225bd038e1d9f2b6397c
6
+ metadata.gz: 7db579a7486a59e6d9890a1b0649357f2301b0537e2329b390069d253f5d2de7f5c10e36850e783dbdc1725639409265f6f0555e2e242cb8bac78ac719351f91
7
+ data.tar.gz: 0705f2597c78fccd4c8c4da8c4bd90a7efada8f35ebd89ab624dbc2ad427494f04135a6425e4573e69e62678977c1f434bdd00bfb406cd909163be213caf5367
@@ -0,0 +1,64 @@
1
+ name: Run rspec, rubocop
2
+
3
+ on:
4
+ pull_request:
5
+ workflow_dispatch:
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ rspec:
12
+ runs-on: ubuntu-latest
13
+ timeout-minutes: 10
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ ruby: [2.7.6, 3.0.4, 3.1.2]
18
+ name: Ruby ${{ matrix.ruby }}
19
+ steps:
20
+ - name: Get branch names
21
+ id: branch-name
22
+ uses: tj-actions/branch-names@v4.9
23
+ - uses: actions/checkout@v3
24
+ - uses: ruby/setup-ruby@v1
25
+ with:
26
+ bundler-cache: true
27
+ ruby-version: ${{ matrix.ruby }}
28
+ - run: bundle exec rspec
29
+
30
+ codeclimate:
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: tj-actions/branch-names@v4.9
34
+ id: branch-name
35
+ - uses: actions/checkout@v3
36
+ - uses: ruby/setup-ruby@v1
37
+ with:
38
+ ruby-version: 2.7.6
39
+ bundler-cache: true
40
+ - name: Test & publish code coverage
41
+ if: "${{ env.CC_TEST_REPORTER_ID != '' }}"
42
+ uses: paambaati/codeclimate-action@v2.7.5
43
+ env:
44
+ CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
45
+ GIT_BRANCH: ${{ steps.branch-name.outputs.current_branch }}
46
+ GIT_COMMIT_SHA: ${{ github.sha }}
47
+ with:
48
+ coverageCommand: bundle exec rspec
49
+
50
+ rubocop:
51
+ runs-on: ubuntu-latest
52
+ timeout-minutes: 10
53
+ steps:
54
+ - name: Checkout code
55
+ uses: actions/checkout@v3
56
+
57
+ - name: Set up Ruby
58
+ uses: ruby/setup-ruby@v1
59
+ with:
60
+ bundler-cache: true
61
+ ruby-version: 2.7.6
62
+
63
+ - name: Run rubocop
64
+ run: bundle exec rubocop
data/.gitignore CHANGED
@@ -10,3 +10,6 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+
14
+ Gemfile.lock
15
+ .ruby-version
data/.rubocop.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.5
2
+ TargetRubyVersion: 2.7
3
+ NewCops: enable
3
4
 
4
5
  Metrics/BlockLength:
5
6
  Enabled: false
@@ -11,4 +12,4 @@ Metrics/LineLength:
11
12
  Max: 120
12
13
 
13
14
  Style/Documentation:
14
- Enabled: false
15
+ Enabled: false
@@ -23,17 +23,20 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
25
25
 
26
- spec.add_dependency 'graphql', '~> 1.8'
26
+ spec.required_ruby_version = '>= 2.7'
27
+
28
+ spec.add_dependency 'graphql', '~> 1.9'
27
29
  spec.add_dependency 'kaminari', '~> 1.1'
28
30
 
29
- spec.add_development_dependency 'activerecord', '~> 5.0'
30
- spec.add_development_dependency 'bundler', '~> 1.16'
31
+ spec.add_development_dependency 'activerecord', '~> 6.0'
32
+ spec.add_development_dependency 'bundler', '~> 2.2'
31
33
  spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0'
32
34
  spec.add_development_dependency 'pry', '0.11.3'
33
35
  spec.add_development_dependency 'rake', '~> 10.0'
34
36
  spec.add_development_dependency 'rspec', '~> 3.0'
35
- spec.add_development_dependency 'rubocop', '~> 0.59.1'
36
- spec.add_development_dependency 'rubocop-rspec', '~> 1.29'
37
+ spec.add_development_dependency 'rubocop', '~> 1.37.1'
38
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.14.1'
37
39
  spec.add_development_dependency 'simplecov', '~> 0.13'
38
40
  spec.add_development_dependency 'sqlite3', '~> 1.3'
41
+ spec.metadata['rubygems_mfa_required'] = 'true'
39
42
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GraphQL
4
4
  module KaminariConnection
5
- VERSION = '0.1.0'
5
+ VERSION = '1.0.0'
6
6
  end
7
7
  end
@@ -54,6 +54,7 @@ module GraphQL
54
54
  field :next_page, 'Int', null: true
55
55
  field :prev_page, 'Int', null: true
56
56
  field :total_pages, 'Int', null: false unless without_count
57
+ field :total_count, 'Int', null: false unless without_count
57
58
  end
58
59
  end
59
60
  end
@@ -86,8 +87,8 @@ module GraphQL
86
87
 
87
88
  def page_arguments
88
89
  [
89
- [:page, type: 'Int', required: false],
90
- [:per, type: 'Int', required: false]
90
+ [:page, { type: 'Int', required: false }],
91
+ [:per, { type: 'Int', required: false }]
91
92
  ]
92
93
  end
93
94
 
@@ -103,8 +104,8 @@ module GraphQL
103
104
  graphql_name type_name
104
105
  description "Autogenerated page type for #{type_name}"
105
106
 
106
- field :page_data, page_data_type_class, null: false, method: :object
107
- field :items, [type_class], 'A list of items', null: false, method: :object
107
+ field :page_data, page_data_type_class, null: false, method: :itself
108
+ field :items, [type_class], 'A list of items', null: false, method: :itself
108
109
  end
109
110
  end
110
111
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-kaminari_connection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuku TAKAHASHI
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-28 00:00:00.000000000 Z
11
+ date: 2022-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.8'
19
+ version: '1.9'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.8'
26
+ version: '1.9'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: kaminari
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.0'
47
+ version: '6.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '5.0'
54
+ version: '6.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.16'
61
+ version: '2.2'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.16'
68
+ version: '2.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: codeclimate-test-reporter
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -128,28 +128,28 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.59.1
131
+ version: 1.37.1
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.59.1
138
+ version: 1.37.1
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rubocop-rspec
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '1.29'
145
+ version: 2.14.1
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '1.29'
152
+ version: 2.14.1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: simplecov
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -178,20 +178,19 @@ dependencies:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: '1.3'
181
- description:
181
+ description:
182
182
  email:
183
183
  - yuku@qiita.com
184
184
  executables: []
185
185
  extensions: []
186
186
  extra_rdoc_files: []
187
187
  files:
188
+ - ".github/workflows/test.yml"
188
189
  - ".gitignore"
189
190
  - ".rspec"
190
191
  - ".rubocop.yml"
191
- - ".travis.yml"
192
192
  - CODE_OF_CONDUCT.md
193
193
  - Gemfile
194
- - Gemfile.lock
195
194
  - LICENSE.txt
196
195
  - README.md
197
196
  - Rakefile
@@ -203,8 +202,9 @@ files:
203
202
  homepage: https://github.com/increments/graphql-kaminari_connection
204
203
  licenses:
205
204
  - MIT
206
- metadata: {}
207
- post_install_message:
205
+ metadata:
206
+ rubygems_mfa_required: 'true'
207
+ post_install_message:
208
208
  rdoc_options: []
209
209
  require_paths:
210
210
  - lib
@@ -212,16 +212,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - ">="
214
214
  - !ruby/object:Gem::Version
215
- version: '0'
215
+ version: '2.7'
216
216
  required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  requirements:
218
218
  - - ">="
219
219
  - !ruby/object:Gem::Version
220
220
  version: '0'
221
221
  requirements: []
222
- rubyforge_project:
223
- rubygems_version: 2.7.6
224
- signing_key:
222
+ rubygems_version: 3.1.6
223
+ signing_key:
225
224
  specification_version: 4
226
225
  summary: Kaminari based GraphQL pagination
227
226
  test_files: []
data/.travis.yml DELETED
@@ -1,13 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- - 2.5.1
5
- before_install: gem install bundler -v 1.16.3
6
- notifications:
7
- email: false
8
- script:
9
- - bundle exec rake rubocop
10
- - bundle exec rake spec
11
-
12
- after_success:
13
- - bundle exec codeclimate-test-reporter
data/Gemfile.lock DELETED
@@ -1,130 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- graphql-kaminari_connection (0.1.0)
5
- graphql (~> 1.8)
6
- kaminari (~> 1.1)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actionview (5.2.1)
12
- activesupport (= 5.2.1)
13
- builder (~> 3.1)
14
- erubi (~> 1.4)
15
- rails-dom-testing (~> 2.0)
16
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
17
- activemodel (5.2.1)
18
- activesupport (= 5.2.1)
19
- activerecord (5.2.1)
20
- activemodel (= 5.2.1)
21
- activesupport (= 5.2.1)
22
- arel (>= 9.0)
23
- activesupport (5.2.1)
24
- concurrent-ruby (~> 1.0, >= 1.0.2)
25
- i18n (>= 0.7, < 2)
26
- minitest (~> 5.1)
27
- tzinfo (~> 1.1)
28
- arel (9.0.0)
29
- ast (2.4.0)
30
- builder (3.2.3)
31
- codeclimate-test-reporter (1.0.7)
32
- simplecov
33
- coderay (1.1.2)
34
- concurrent-ruby (1.0.5)
35
- crass (1.0.4)
36
- diff-lcs (1.3)
37
- docile (1.3.1)
38
- erubi (1.7.1)
39
- graphql (1.8.10)
40
- i18n (1.1.0)
41
- concurrent-ruby (~> 1.0)
42
- jaro_winkler (1.5.1)
43
- json (2.1.0)
44
- kaminari (1.1.1)
45
- activesupport (>= 4.1.0)
46
- kaminari-actionview (= 1.1.1)
47
- kaminari-activerecord (= 1.1.1)
48
- kaminari-core (= 1.1.1)
49
- kaminari-actionview (1.1.1)
50
- actionview
51
- kaminari-core (= 1.1.1)
52
- kaminari-activerecord (1.1.1)
53
- activerecord
54
- kaminari-core (= 1.1.1)
55
- kaminari-core (1.1.1)
56
- loofah (2.2.2)
57
- crass (~> 1.0.2)
58
- nokogiri (>= 1.5.9)
59
- method_source (0.9.0)
60
- mini_portile2 (2.3.0)
61
- minitest (5.11.3)
62
- nokogiri (1.8.4)
63
- mini_portile2 (~> 2.3.0)
64
- parallel (1.12.1)
65
- parser (2.5.1.2)
66
- ast (~> 2.4.0)
67
- powerpack (0.1.2)
68
- pry (0.11.3)
69
- coderay (~> 1.1.0)
70
- method_source (~> 0.9.0)
71
- rails-dom-testing (2.0.3)
72
- activesupport (>= 4.2.0)
73
- nokogiri (>= 1.6)
74
- rails-html-sanitizer (1.0.4)
75
- loofah (~> 2.2, >= 2.2.2)
76
- rainbow (3.0.0)
77
- rake (10.5.0)
78
- rspec (3.8.0)
79
- rspec-core (~> 3.8.0)
80
- rspec-expectations (~> 3.8.0)
81
- rspec-mocks (~> 3.8.0)
82
- rspec-core (3.8.0)
83
- rspec-support (~> 3.8.0)
84
- rspec-expectations (3.8.1)
85
- diff-lcs (>= 1.2.0, < 2.0)
86
- rspec-support (~> 3.8.0)
87
- rspec-mocks (3.8.0)
88
- diff-lcs (>= 1.2.0, < 2.0)
89
- rspec-support (~> 3.8.0)
90
- rspec-support (3.8.0)
91
- rubocop (0.59.2)
92
- jaro_winkler (~> 1.5.1)
93
- parallel (~> 1.10)
94
- parser (>= 2.5, != 2.5.1.1)
95
- powerpack (~> 0.1)
96
- rainbow (>= 2.2.2, < 4.0)
97
- ruby-progressbar (~> 1.7)
98
- unicode-display_width (~> 1.0, >= 1.0.1)
99
- rubocop-rspec (1.29.1)
100
- rubocop (>= 0.58.0)
101
- ruby-progressbar (1.10.0)
102
- simplecov (0.16.1)
103
- docile (~> 1.1)
104
- json (>= 1.8, < 3)
105
- simplecov-html (~> 0.10.0)
106
- simplecov-html (0.10.2)
107
- sqlite3 (1.3.13)
108
- thread_safe (0.3.6)
109
- tzinfo (1.2.5)
110
- thread_safe (~> 0.1)
111
- unicode-display_width (1.4.0)
112
-
113
- PLATFORMS
114
- ruby
115
-
116
- DEPENDENCIES
117
- activerecord (~> 5.0)
118
- bundler (~> 1.16)
119
- codeclimate-test-reporter (~> 1.0)
120
- graphql-kaminari_connection!
121
- pry (= 0.11.3)
122
- rake (~> 10.0)
123
- rspec (~> 3.0)
124
- rubocop (~> 0.59.1)
125
- rubocop-rspec (~> 1.29)
126
- simplecov (~> 0.13)
127
- sqlite3 (~> 1.3)
128
-
129
- BUNDLED WITH
130
- 1.16.3