graphqr 0.0.7 → 0.0.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 202dc11b523d09002098ed66bcb2bc734a6e4f85fe6ab9a2a7f94cac5b295be8
|
4
|
+
data.tar.gz: b824d121adb074e1ffc93d3a42f9f1d976c2a854970c904e49b98644b8282dbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ca1c6ff7d958e446daa4c7df652728d86157f502a9681e5a3e90e5fc80c6ae433be93120099cb3e15e0b3f62c2d3c4497a7b187ebe2dce30dd185ce2c26bac1
|
7
|
+
data.tar.gz: d89ab5d2beddfa96b0937aa6bd414e8941ceb41b9b1748aba5600b895b1e16f5a06f2dab0748d9c2b256df0b661aaf11c7ffcb5404830cf0ea12d95a4041bd42
|
@@ -34,8 +34,8 @@ module GraphQR
|
|
34
34
|
|
35
35
|
def page_info
|
36
36
|
@pagy.tap do |pagy|
|
37
|
-
pagy.class_eval { attr_accessor :
|
38
|
-
pagy.
|
37
|
+
pagy.class_eval { attr_accessor :ordered_record_ids_proc }
|
38
|
+
pagy.ordered_record_ids_proc = -> { @records&.all? { |r| r&.respond_to?(:id) } ? @records.map(&:id) : [] }
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -15,7 +15,7 @@ module GraphQR
|
|
15
15
|
|
16
16
|
def resolve(record_id:)
|
17
17
|
per_page = object.vars[:items]
|
18
|
-
records_ids = object.
|
18
|
+
records_ids = object.ordered_record_ids_proc.call
|
19
19
|
record_index = records_ids.find_index(record_id.to_i)
|
20
20
|
|
21
21
|
return if per_page.zero? || records_ids.blank? || record_index.blank?
|
@@ -26,4 +26,4 @@ module GraphQR
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
29
|
-
end
|
29
|
+
end
|
data/lib/graphqr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphqr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Puyol
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-05-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: graphql
|
@@ -52,14 +52,14 @@ dependencies:
|
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '13.0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
58
|
version_requirements: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '13.0'
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: rdoc
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|
@@ -187,5 +187,5 @@ signing_key:
|
|
187
187
|
specification_version: 4
|
188
188
|
summary: Extensions and helpers for graphql-ruby
|
189
189
|
test_files:
|
190
|
-
- spec/spec_helper.rb
|
191
190
|
- spec/graphqr_spec.rb
|
191
|
+
- spec/spec_helper.rb
|