graphql-pagination 2.5.0 → 2.6.1

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: 9475b513e2ced37bbd798e3c254cd6e59e6ba3bb84fca82ceb3735b9202cc7f1
4
- data.tar.gz: 6ff8b16a00b6e2036aac8e137913008fead15f6ed5f201758c371380b8e1801e
3
+ metadata.gz: ac285de80e7ce829af8cde768b1b48ee20b050ac2692323c2eac8fbad735c5d9
4
+ data.tar.gz: 3f506c1c052fc3ff22b0adedebf88efd75ac269bf1b5eff3793e8ad72f0cd984
5
5
  SHA512:
6
- metadata.gz: 1c4cae67537d17e7de4e0844aff5c13a068c9e9b6b84bdd086b477229bcb80d9a88aafffad4d02ddaebc0d4719b903d8088d540a12af123a7a2e3a871a9677e5
7
- data.tar.gz: c4e76b225701a6025e2924b4aa6600815272a26883a4990ae81c9607152032db965941f3fd6a91af92703f1825957b2cb367c9f768654896be6d925ac138a61f
6
+ metadata.gz: 610459159c73779ec4ecfbe81eb7c3fc4bf3772f1334ac9e3b3cdae0f197b7cfdf9001b35a8ca919c21c33da4735888a27e1b6095bea2276b1ef1e7be43257ac
7
+ data.tar.gz: 3e30b245b1095f63c5fec115a82c3ccddf86a4a94f59a19faa24ea0e491b508ae1fcc490bc4a89d7618ec66a639fe1c47faf62cf84a453f638fb548fb4e656ed
data/.bundler-version CHANGED
@@ -1 +1 @@
1
- 4.0.7
1
+ 4.0.10
data/.standard.yml ADDED
@@ -0,0 +1,2 @@
1
+ format: progress
2
+ parallel: true
data/CHANGELOG.md ADDED
@@ -0,0 +1,38 @@
1
+ ## [Unreleased]
2
+
3
+ ## [2.6.1] - 2026-04-28
4
+
5
+ ### Fixed
6
+ - Defer `CollectionMetadataType` load so the Federation 2 `@shareable` conditional fires correctly (#254)
7
+
8
+ ## [2.6.0] - 2026-04-28
9
+
10
+ ### Changed
11
+ - Mark `CollectionMetadataType` as `@shareable` under Federation 2 (#253)
12
+ - Bump graphql from 2.5.23 to 2.6.0 (#252)
13
+
14
+ ## [2.5.0] - 2026-04-08
15
+
16
+ ### Added
17
+ - `paginated_field` helper to reduce pagination boilerplate (#239)
18
+ - Complexity calculation for collection fields (#240)
19
+ - `collection_type` support for GraphQL resolvers (#241)
20
+ - Ruby 4.0 support
21
+
22
+ ### Security
23
+ - Update activesupport to 8.1.2.1 and json to 2.19.2 to fix vulnerabilities (#250)
24
+
25
+ ### Changed
26
+ - Replace RuboCop with StandardRB
27
+ - Bump graphql from 2.5.18 to 2.5.19 (#243)
28
+ - Upgrade dependencies
29
+
30
+ ## [2.4.1] - 2025-09-29
31
+
32
+ ## [2.4.0] - 2025-02-05
33
+
34
+ ## [2.3.0] - 2024-12-09
35
+
36
+ ## [2.2.0] - 2024-02-29
37
+
38
+ ## [2.1.3] - 2023-09-17
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql-pagination (2.5.0)
4
+ graphql-pagination (2.6.1)
5
5
  graphql (>= 2.4.7)
6
6
 
7
7
  GEM
@@ -35,16 +35,16 @@ GEM
35
35
  date (3.5.1)
36
36
  diff-lcs (1.6.2)
37
37
  drb (2.2.3)
38
- erb (6.0.2)
38
+ erb (6.0.4)
39
39
  fiber-storage (1.0.1)
40
- graphql (2.5.23)
40
+ graphql (2.6.0)
41
41
  base64
42
42
  fiber-storage
43
43
  logger
44
44
  i18n (1.14.8)
45
45
  concurrent-ruby (~> 1.0)
46
46
  io-console (0.8.2)
47
- irb (1.17.0)
47
+ irb (1.18.0)
48
48
  pp (>= 0.6.0)
49
49
  prism (>= 1.3.0)
50
50
  rdoc (>= 4.0.0)
@@ -58,7 +58,7 @@ GEM
58
58
  lint_roller (1.1.0)
59
59
  logger (1.7.0)
60
60
  method_source (1.1.0)
61
- minitest (6.0.3)
61
+ minitest (6.0.4)
62
62
  drb (~> 2.0)
63
63
  prism (~> 1.5)
64
64
  openssl (4.0.1)
@@ -80,7 +80,7 @@ GEM
80
80
  stringio
81
81
  racc (1.8.1)
82
82
  rainbow (3.1.1)
83
- rake (13.3.1)
83
+ rake (13.4.2)
84
84
  rdoc (7.2.0)
85
85
  erb
86
86
  psych (>= 4.0.0)
data/README.md CHANGED
@@ -7,7 +7,7 @@ Implements page-based pagination returning collection and pagination metadata. I
7
7
 
8
8
  ## Installation
9
9
 
10
- Add `graphql-pagination` to your Gemfile, you can use `kaminari-activerecord` or `kaminari-monogid` to not implement page scope methods. Kaminari is not loaded by the gem, so you need to decide and load it on your own.
10
+ Add `graphql-pagination` to your Gemfile, you can use `kaminari-activerecord` or `kaminari-mongoid` to not implement page scope methods. Kaminari is not loaded by the gem, so you need to decide and load it on your own.
11
11
 
12
12
  ```ruby
13
13
  gem 'graphql-pagination'
@@ -82,6 +82,8 @@ This automatically adds `page` and `per` arguments (both optional) to the field.
82
82
 
83
83
  ## GraphQL query
84
84
 
85
+ When using manual field definitions (with `limit` argument):
86
+
85
87
  ```graphql
86
88
  {
87
89
  fruits(page: 2, limit: 2) {
@@ -99,10 +101,29 @@ This automatically adds `page` and `per` arguments (both optional) to the field.
99
101
  }
100
102
  ```
101
103
 
104
+ When using the `paginated_field` helper (with `per` argument):
105
+
106
+ ```graphql
107
+ {
108
+ fruits(page: 2, per: 2) {
109
+ collection {
110
+ id
111
+ name
112
+ }
113
+ metadata {
114
+ totalPages
115
+ totalCount
116
+ currentPage
117
+ limitValue
118
+ }
119
+ }
120
+ }
121
+ ```
122
+
102
123
  ```json
103
124
  {
104
125
  "data": {
105
- "checklists": {
126
+ "fruits": {
106
127
  "collection": [
107
128
  {
108
129
  "id": "93938bb3-7a6c-4d35-9961-cbb2d4c9e9ac",
@@ -216,6 +237,16 @@ The complexity will be calculated as:
216
237
 
217
238
  If no `limit` or `per` argument is provided, it will use the schema's default page size or fall back to 25 (Kaminari's default).
218
239
 
240
+ To enforce complexity limits, set `max_complexity` on your schema:
241
+
242
+ ```ruby
243
+ class MySchema < GraphQL::Schema
244
+ max_complexity 200
245
+ end
246
+ ```
247
+
248
+ Queries exceeding this threshold will be rejected before execution.
249
+
219
250
  ## Contributing
220
251
 
221
252
  Bug reports and pull requests are welcome on GitHub at https://github.com/renofi/graphql-pagination. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -1,5 +1,12 @@
1
1
  module GraphqlPagination
2
2
  class CollectionMetadataType < GraphQL::Schema::Object
3
+ if defined?(ApolloFederation::Object) && defined?(Reconf) &&
4
+ Gem::Version.new(Reconf.fetch("renoql.federation_version") { "1.0" }.to_s) >= Gem::Version.new("2.0.0")
5
+ include ApolloFederation::Object
6
+
7
+ shareable
8
+ end
9
+
3
10
  description "Type for CollectionMetadataType"
4
11
  field :current_page, Integer, null: false, description: "Current Page of loaded data"
5
12
  field :limit_value, Integer, null: false, description: "The number of items per page"
@@ -1,3 +1,3 @@
1
1
  module GraphqlPagination
2
- VERSION = "2.5.0".freeze
2
+ VERSION = "2.6.1".freeze
3
3
  end
@@ -3,11 +3,11 @@ require "graphql"
3
3
  require "graphql/schema"
4
4
 
5
5
  module GraphqlPagination
6
+ autoload :CollectionMetadataType, "graphql_pagination/collection_metadata_type"
6
7
  end
7
8
 
8
9
  require "graphql_pagination/collection_base_error"
9
10
  require "graphql_pagination/collection_type"
10
- require "graphql_pagination/collection_metadata_type"
11
11
  require "graphql_pagination/collection_field"
12
12
  require "graphql_pagination/paginated_field"
13
13
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-pagination
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Knapik
@@ -45,6 +45,8 @@ files:
45
45
  - ".github/workflows/ci.yml"
46
46
  - ".gitignore"
47
47
  - ".rspec"
48
+ - ".standard.yml"
49
+ - CHANGELOG.md
48
50
  - Gemfile
49
51
  - Gemfile.lock
50
52
  - LICENSE
@@ -81,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
83
  - !ruby/object:Gem::Version
82
84
  version: '0'
83
85
  requirements: []
84
- rubygems_version: 4.0.9
86
+ rubygems_version: 4.0.3
85
87
  specification_version: 4
86
88
  summary: Page-based kaminari pagination for graphql.
87
89
  test_files: []