graphql-paging 0.1.0.beta1 → 0.1.0.beta2
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 +4 -4
- data/README.md +10 -2
- data/lib/graphql/paging.rb +1 -1
- data/lib/graphql/paging/page_info.rb +1 -1
- data/lib/graphql/paging/resolver_extension.rb +4 -4
- data/lib/graphql/paging/version.rb +2 -2
- metadata +2 -12
- data/.gitignore +0 -11
- data/.rspec +0 -3
- data/.travis.yml +0 -7
- data/CODE_OF_CONDUCT.md +0 -74
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -89
- data/Rakefile +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/graphql-paging.gemspec +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f8e37a1101fe27922433ad460dfdb189d3b17f8209a3cb7ae3b6704aa91d00e
|
4
|
+
data.tar.gz: 978108d3ad07358e31a3c1ff61544032da1d7ea523049e30aeb39fe8d0ec4115
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0860c49c1f30eb232df93386a74be24563a00a58df4514e9b2a303e4d907d3f2a6faa3449724b308c8fb45d62b5b0c9a05cdee2bf496e0a178c711cb0cf44350'
|
7
|
+
data.tar.gz: 836a8ff0d587a0da768326d2bb39e0fbcae862d072ca2fd4a43c74ef3020426acb056d0934717284a247f48b044f611e767032f0e572f29cf92c32d6277b4a68
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Graphql::Paging
|
2
2
|
|
3
|
+

|
4
|
+
|
3
5
|
NOTE: If you need cursor-based pagination, [relay connection](https://graphql-ruby.org/relay/connections.html) is good for you.
|
4
6
|
|
5
7
|
A page-based pagination extension for graphql gem, only support kaminari currently.
|
@@ -25,6 +27,12 @@ Or install it yourself as:
|
|
25
27
|
|
26
28
|
## Usage
|
27
29
|
|
30
|
+
Require the library
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
require 'graphql/paging'
|
34
|
+
```
|
35
|
+
|
28
36
|
Include `GraphQL::Paging::ResolverExtension` in resolver and use `paginate` method.
|
29
37
|
|
30
38
|
```ruby
|
@@ -130,7 +138,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
130
138
|
|
131
139
|
## Contributing
|
132
140
|
|
133
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
141
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/bastengao/graphql-paging. 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.
|
134
142
|
|
135
143
|
## License
|
136
144
|
|
@@ -138,4 +146,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
138
146
|
|
139
147
|
## Code of Conduct
|
140
148
|
|
141
|
-
Everyone interacting in the Graphql::Paging project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
149
|
+
Everyone interacting in the Graphql::Paging project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/bastengao/graphql-paging/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/graphql/paging.rb
CHANGED
@@ -23,8 +23,8 @@ module GraphQL
|
|
23
23
|
|
24
24
|
type pagination, null: false
|
25
25
|
|
26
|
-
argument :page, Int, "return _n_ th page",
|
27
|
-
argument :per, Int, "return _n_ elements per page", required: false
|
26
|
+
argument :page, Int, "return the _n_ th page.", required: false
|
27
|
+
argument :per, Int, "return _n_ elements per page.", required: false
|
28
28
|
end
|
29
29
|
|
30
30
|
private
|
@@ -39,8 +39,8 @@ module GraphQL
|
|
39
39
|
klass = Class.new(_object_class) do
|
40
40
|
graphql_name(pagination_name)
|
41
41
|
|
42
|
-
field :page_info, PageInfo, null: false
|
43
|
-
field :nodes, [wrapped_type],
|
42
|
+
field :page_info, PageInfo, "Information to aid in pagination.", null: false
|
43
|
+
field :nodes, [wrapped_type], "A list of nodes.", null: true
|
44
44
|
|
45
45
|
def page_info
|
46
46
|
paged_data
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-paging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bastengao
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -93,18 +93,8 @@ executables: []
|
|
93
93
|
extensions: []
|
94
94
|
extra_rdoc_files: []
|
95
95
|
files:
|
96
|
-
- ".gitignore"
|
97
|
-
- ".rspec"
|
98
|
-
- ".travis.yml"
|
99
|
-
- CODE_OF_CONDUCT.md
|
100
|
-
- Gemfile
|
101
|
-
- Gemfile.lock
|
102
96
|
- LICENSE.txt
|
103
97
|
- README.md
|
104
|
-
- Rakefile
|
105
|
-
- bin/console
|
106
|
-
- bin/setup
|
107
|
-
- graphql-paging.gemspec
|
108
98
|
- lib/graphql/paging.rb
|
109
99
|
- lib/graphql/paging/page_info.rb
|
110
100
|
- lib/graphql/paging/resolver_extension.rb
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
-
orientation.
|
11
|
-
|
12
|
-
## Our Standards
|
13
|
-
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
15
|
-
include:
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
22
|
-
|
23
|
-
Examples of unacceptable behavior by participants include:
|
24
|
-
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
-
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
30
|
-
address, without explicit permission
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
-
professional setting
|
33
|
-
|
34
|
-
## Our Responsibilities
|
35
|
-
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
39
|
-
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
45
|
-
|
46
|
-
## Scope
|
47
|
-
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
54
|
-
|
55
|
-
## Enforcement
|
56
|
-
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at bastengao@gmail.com. All
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
63
|
-
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
66
|
-
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
-
|
73
|
-
[homepage]: http://contributor-covenant.org
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
graphql-paging (0.1.0.beta1)
|
5
|
-
graphql (>= 1.8, < 2)
|
6
|
-
kaminari (>= 1.0.0)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: https://rubygems.org/
|
10
|
-
specs:
|
11
|
-
actionview (6.0.0)
|
12
|
-
activesupport (= 6.0.0)
|
13
|
-
builder (~> 3.1)
|
14
|
-
erubi (~> 1.4)
|
15
|
-
rails-dom-testing (~> 2.0)
|
16
|
-
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
17
|
-
activemodel (6.0.0)
|
18
|
-
activesupport (= 6.0.0)
|
19
|
-
activerecord (6.0.0)
|
20
|
-
activemodel (= 6.0.0)
|
21
|
-
activesupport (= 6.0.0)
|
22
|
-
activesupport (6.0.0)
|
23
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
24
|
-
i18n (>= 0.7, < 2)
|
25
|
-
minitest (~> 5.1)
|
26
|
-
tzinfo (~> 1.1)
|
27
|
-
zeitwerk (~> 2.1, >= 2.1.8)
|
28
|
-
builder (3.2.3)
|
29
|
-
concurrent-ruby (1.1.5)
|
30
|
-
crass (1.0.4)
|
31
|
-
diff-lcs (1.3)
|
32
|
-
erubi (1.8.0)
|
33
|
-
graphql (1.9.10)
|
34
|
-
i18n (1.6.0)
|
35
|
-
concurrent-ruby (~> 1.0)
|
36
|
-
kaminari (1.1.1)
|
37
|
-
activesupport (>= 4.1.0)
|
38
|
-
kaminari-actionview (= 1.1.1)
|
39
|
-
kaminari-activerecord (= 1.1.1)
|
40
|
-
kaminari-core (= 1.1.1)
|
41
|
-
kaminari-actionview (1.1.1)
|
42
|
-
actionview
|
43
|
-
kaminari-core (= 1.1.1)
|
44
|
-
kaminari-activerecord (1.1.1)
|
45
|
-
activerecord
|
46
|
-
kaminari-core (= 1.1.1)
|
47
|
-
kaminari-core (1.1.1)
|
48
|
-
loofah (2.2.3)
|
49
|
-
crass (~> 1.0.2)
|
50
|
-
nokogiri (>= 1.5.9)
|
51
|
-
mini_portile2 (2.4.0)
|
52
|
-
minitest (5.11.3)
|
53
|
-
nokogiri (1.10.4)
|
54
|
-
mini_portile2 (~> 2.4.0)
|
55
|
-
rails-dom-testing (2.0.3)
|
56
|
-
activesupport (>= 4.2.0)
|
57
|
-
nokogiri (>= 1.6)
|
58
|
-
rails-html-sanitizer (1.2.0)
|
59
|
-
loofah (~> 2.2, >= 2.2.2)
|
60
|
-
rake (10.5.0)
|
61
|
-
rspec (3.8.0)
|
62
|
-
rspec-core (~> 3.8.0)
|
63
|
-
rspec-expectations (~> 3.8.0)
|
64
|
-
rspec-mocks (~> 3.8.0)
|
65
|
-
rspec-core (3.8.2)
|
66
|
-
rspec-support (~> 3.8.0)
|
67
|
-
rspec-expectations (3.8.4)
|
68
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
69
|
-
rspec-support (~> 3.8.0)
|
70
|
-
rspec-mocks (3.8.1)
|
71
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
72
|
-
rspec-support (~> 3.8.0)
|
73
|
-
rspec-support (3.8.2)
|
74
|
-
thread_safe (0.3.6)
|
75
|
-
tzinfo (1.2.5)
|
76
|
-
thread_safe (~> 0.1)
|
77
|
-
zeitwerk (2.1.9)
|
78
|
-
|
79
|
-
PLATFORMS
|
80
|
-
ruby
|
81
|
-
|
82
|
-
DEPENDENCIES
|
83
|
-
bundler (~> 1.17)
|
84
|
-
graphql-paging!
|
85
|
-
rake (~> 10.0)
|
86
|
-
rspec (~> 3.0)
|
87
|
-
|
88
|
-
BUNDLED WITH
|
89
|
-
1.17.2
|
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "graphql/paging"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/graphql-paging.gemspec
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require "graphql/paging/version"
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "graphql-paging"
|
8
|
-
spec.version = Graphql::Paging::VERSION
|
9
|
-
spec.authors = ["bastengao"]
|
10
|
-
spec.email = ["bastengao@gmail.com"]
|
11
|
-
|
12
|
-
spec.summary = %q{A page-based pagination extension for graphql gem}
|
13
|
-
spec.homepage = "https://github.com/bastengao/graphql-paging"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
# Specify which files should be added to the gem when it is released.
|
17
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
18
|
-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
19
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
-
end
|
21
|
-
spec.bindir = "exe"
|
22
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
-
spec.require_paths = ["lib"]
|
24
|
-
|
25
|
-
spec.add_dependency "graphql", ">= 1.8", "< 2"
|
26
|
-
spec.add_dependency "kaminari", ">= 1.0.0"
|
27
|
-
|
28
|
-
spec.add_development_dependency "bundler", "~> 1.17"
|
29
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
30
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
31
|
-
end
|