cm-graphql 0.0.8 → 0.0.9
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/app/graphql/types/paging_type_helper.rb +18 -0
- data/cm-graphql.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 758a8b6daf923d26b773c0a04bbe5ab726a4dab30a71bfeff618becb834d7e5c
|
4
|
+
data.tar.gz: 58cc8baa28e455f81cb08a3c76f43aea316aaca6876cb3e52998f9fa9abb387a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d37692766e2d364ba375e8ca6edbf4d020e30c59ce52ab7a74af22140773f912d128a84fbfe7d9a5966f7117b8cb55afb356ce4a37a5da6b4e53720d3d7ad92c
|
7
|
+
data.tar.gz: 58c290483985272013600c67499e167099509203226b0b94068c498e75c5fdff3c99251b75807a796541e183e9a5c54253dc3a08745d2efbdb95be40ade74c19
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Types
|
2
|
+
module PagingTypeHelper
|
3
|
+
def self.paging_type_for_model(model:, record_data_type: nil, graphql_type_name: nil)
|
4
|
+
Class.new(Types::BaseObject) do
|
5
|
+
graphql_name(graphql_type_name.presence || "#{model}PagingType")
|
6
|
+
|
7
|
+
model_data_type = if record_data_type.present?
|
8
|
+
record_data_type.to_s.constantize
|
9
|
+
else
|
10
|
+
"Types::Objects::#{model}Type".constantize
|
11
|
+
end
|
12
|
+
|
13
|
+
field :paging, Types::Objects::Base::PagingType, null: true
|
14
|
+
field :data, [model_data_type], null: false
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/cm-graphql.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'cm-graphql'
|
5
|
-
spec.version = '0.0.
|
5
|
+
spec.version = '0.0.9'
|
6
6
|
spec.date = '2022-09-14'
|
7
7
|
spec.summary = 'A gem to setup grapqhl basics like pagination, file upload'
|
8
8
|
spec.description = 'A gem to setup grapqhl basics like pagination, file upload'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cm-graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anbazhagan Palani
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- app/graphql/types/inputs/image_resolution.rb
|
99
99
|
- app/graphql/types/objects/base/attachment_type.rb
|
100
100
|
- app/graphql/types/objects/base/paging_type.rb
|
101
|
+
- app/graphql/types/paging_type_helper.rb
|
101
102
|
- app/models/concerns/attachable.rb
|
102
103
|
- app/models/concerns/paginator.rb
|
103
104
|
- app/models/filtered_list.rb
|
@@ -131,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
132
|
- !ruby/object:Gem::Version
|
132
133
|
version: '0'
|
133
134
|
requirements: []
|
134
|
-
rubygems_version: 3.6.
|
135
|
+
rubygems_version: 3.6.9
|
135
136
|
specification_version: 4
|
136
137
|
summary: A gem to setup grapqhl basics like pagination, file upload
|
137
138
|
test_files: []
|