cm-graphql 0.0.7 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfe03ea1105356f62c221657ccf7e1ac08f138cc537a1e28bf70f9ad1aa0e0b7
4
- data.tar.gz: 8275b35c3ba06d16d1be8a32ea6fd0e528c9a6db7c63793d84f2d1e65d62a734
3
+ metadata.gz: 758a8b6daf923d26b773c0a04bbe5ab726a4dab30a71bfeff618becb834d7e5c
4
+ data.tar.gz: 58cc8baa28e455f81cb08a3c76f43aea316aaca6876cb3e52998f9fa9abb387a
5
5
  SHA512:
6
- metadata.gz: 742fa1b707f8fd4e726879779293563da46f8c901f64987fd0897d0ccb6aafcf60a9fb010aa7e58d109da244584bbdc5074ac2d8ef142f6bfdc5c5727b3989da
7
- data.tar.gz: 7ee1c3308c49eb9f5b14ce47c2b2d710160c8087b2bc645326ffb3e3a6b355e68614ca7856879659a14b546225dc19730dd13f22edfd311f0314b1d1f05b4811
6
+ metadata.gz: d37692766e2d364ba375e8ca6edbf4d020e30c59ce52ab7a74af22140773f912d128a84fbfe7d9a5966f7117b8cb55afb356ce4a37a5da6b4e53720d3d7ad92c
7
+ data.tar.gz: 58c290483985272013600c67499e167099509203226b0b94068c498e75c5fdff3c99251b75807a796541e183e9a5c54253dc3a08745d2efbdb95be40ade74c19
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-graphql (0.0.6)
4
+ cm-graphql (0.0.8)
5
5
  graphiql-rails (>= 1.9)
6
6
  graphql (>= 2.2.5)
7
7
  graphql-rails_logger (>= 1.2.4)
@@ -10,61 +10,68 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actionpack (7.1.3.3)
14
- actionview (= 7.1.3.3)
15
- activesupport (= 7.1.3.3)
13
+ actionpack (8.0.2)
14
+ actionview (= 8.0.2)
15
+ activesupport (= 8.0.2)
16
16
  nokogiri (>= 1.8.5)
17
- racc
18
17
  rack (>= 2.2.4)
19
18
  rack-session (>= 1.0.1)
20
19
  rack-test (>= 0.6.3)
21
20
  rails-dom-testing (~> 2.2)
22
21
  rails-html-sanitizer (~> 1.6)
23
- actionview (7.1.3.3)
24
- activesupport (= 7.1.3.3)
22
+ useragent (~> 0.16)
23
+ actionview (8.0.2)
24
+ activesupport (= 8.0.2)
25
25
  builder (~> 3.1)
26
26
  erubi (~> 1.11)
27
27
  rails-dom-testing (~> 2.2)
28
28
  rails-html-sanitizer (~> 1.6)
29
- activemodel (7.1.3.3)
30
- activesupport (= 7.1.3.3)
31
- activerecord (7.1.3.3)
32
- activemodel (= 7.1.3.3)
33
- activesupport (= 7.1.3.3)
29
+ activemodel (8.0.2)
30
+ activesupport (= 8.0.2)
31
+ activerecord (8.0.2)
32
+ activemodel (= 8.0.2)
33
+ activesupport (= 8.0.2)
34
34
  timeout (>= 0.4.0)
35
- activesupport (7.1.3.3)
35
+ activesupport (8.0.2)
36
36
  base64
37
+ benchmark (>= 0.3)
37
38
  bigdecimal
38
- concurrent-ruby (~> 1.0, >= 1.0.2)
39
+ concurrent-ruby (~> 1.0, >= 1.3.1)
39
40
  connection_pool (>= 2.2.5)
40
41
  drb
41
42
  i18n (>= 1.6, < 2)
43
+ logger (>= 1.4.2)
42
44
  minitest (>= 5.1)
43
- mutex_m
44
- tzinfo (~> 2.0)
45
+ securerandom (>= 0.3)
46
+ tzinfo (~> 2.0, >= 2.0.5)
47
+ uri (>= 0.13.1)
45
48
  base64 (0.2.0)
46
- bigdecimal (3.1.8)
49
+ benchmark (0.4.0)
50
+ bigdecimal (3.1.9)
47
51
  builder (3.3.0)
48
- concurrent-ruby (1.3.4)
49
- connection_pool (2.4.1)
52
+ concurrent-ruby (1.3.5)
53
+ connection_pool (2.5.2)
50
54
  crass (1.0.6)
55
+ date (3.4.1)
51
56
  drb (2.2.1)
52
- erubi (1.13.0)
53
- fiber-storage (1.0.0)
54
- graphiql-rails (1.10.1)
57
+ erubi (1.13.1)
58
+ fiber-storage (1.0.1)
59
+ graphiql-rails (1.10.4)
55
60
  railties
56
- graphql (2.3.17)
61
+ graphql (2.5.4)
57
62
  base64
58
63
  fiber-storage
59
- graphql-rails_logger (1.2.4)
64
+ logger
65
+ graphql-rails_logger (1.2.5)
60
66
  actionpack (> 5.0)
61
67
  activesupport (> 5.0)
62
68
  railties (> 5.0)
63
- rouge (~> 3.0)
64
- i18n (1.14.6)
69
+ rouge (>= 3.0)
70
+ i18n (1.14.7)
65
71
  concurrent-ruby (~> 1.0)
66
- io-console (0.7.2)
67
- irb (1.14.1)
72
+ io-console (0.8.0)
73
+ irb (1.15.2)
74
+ pp (>= 0.6.0)
68
75
  rdoc (>= 4.0.0)
69
76
  reline (>= 0.4.2)
70
77
  kaminari (1.2.2)
@@ -79,56 +86,62 @@ GEM
79
86
  activerecord
80
87
  kaminari-core (= 1.2.2)
81
88
  kaminari-core (1.2.2)
82
- loofah (2.22.0)
89
+ logger (1.7.0)
90
+ loofah (2.24.0)
83
91
  crass (~> 1.0.2)
84
92
  nokogiri (>= 1.12.0)
85
- mini_portile2 (2.8.7)
86
- minitest (5.25.1)
87
- mutex_m (0.2.0)
88
- nokogiri (1.16.7)
93
+ mini_portile2 (2.8.8)
94
+ minitest (5.25.5)
95
+ nokogiri (1.18.8)
89
96
  mini_portile2 (~> 2.8.2)
90
97
  racc (~> 1.4)
91
- nokogiri (1.16.7-arm64-darwin)
98
+ nokogiri (1.18.8-arm64-darwin)
92
99
  racc (~> 1.4)
93
- psych (5.1.2)
100
+ pp (0.6.2)
101
+ prettyprint
102
+ prettyprint (0.2.0)
103
+ psych (5.2.3)
104
+ date
94
105
  stringio
95
106
  racc (1.8.1)
96
- rack (3.1.7)
97
- rack-session (2.0.0)
107
+ rack (3.1.13)
108
+ rack-session (2.1.0)
109
+ base64 (>= 0.1.0)
98
110
  rack (>= 3.0.0)
99
- rack-test (2.1.0)
111
+ rack-test (2.2.0)
100
112
  rack (>= 1.3)
101
- rackup (2.1.0)
113
+ rackup (2.2.1)
102
114
  rack (>= 3)
103
- webrick (~> 1.8)
104
115
  rails-dom-testing (2.2.0)
105
116
  activesupport (>= 5.0.0)
106
117
  minitest
107
118
  nokogiri (>= 1.6)
108
- rails-html-sanitizer (1.6.0)
119
+ rails-html-sanitizer (1.6.2)
109
120
  loofah (~> 2.21)
110
- nokogiri (~> 1.14)
111
- railties (7.1.3.3)
112
- actionpack (= 7.1.3.3)
113
- activesupport (= 7.1.3.3)
114
- irb
121
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
122
+ railties (8.0.2)
123
+ actionpack (= 8.0.2)
124
+ activesupport (= 8.0.2)
125
+ irb (~> 1.13)
115
126
  rackup (>= 1.0.0)
116
127
  rake (>= 12.2)
117
128
  thor (~> 1.0, >= 1.2.2)
118
129
  zeitwerk (~> 2.6)
119
130
  rake (13.2.1)
120
- rdoc (6.7.0)
131
+ rdoc (6.13.1)
121
132
  psych (>= 4.0.0)
122
- reline (0.5.10)
133
+ reline (0.6.1)
123
134
  io-console (~> 0.5)
124
- rouge (3.30.0)
125
- stringio (3.1.1)
135
+ rouge (4.5.1)
136
+ securerandom (0.4.1)
137
+ stringio (3.1.7)
126
138
  thor (1.3.2)
127
- timeout (0.4.1)
139
+ timeout (0.4.3)
128
140
  tzinfo (2.0.6)
129
141
  concurrent-ruby (~> 1.0)
130
- webrick (1.8.2)
131
- zeitwerk (2.6.18)
142
+ uri (1.0.3)
143
+ useragent (0.16.11)
144
+ zeitwerk (2.7.2)
132
145
 
133
146
  PLATFORMS
134
147
  arm64-darwin-20
@@ -139,4 +152,4 @@ DEPENDENCIES
139
152
  cm-graphql!
140
153
 
141
154
  BUNDLED WITH
142
- 2.2.33
155
+ 2.6.8
@@ -0,0 +1,27 @@
1
+ module Types
2
+ module EnumHelpers
3
+ def self.enum_from_model(model, enum_name, graphql_enum_name: nil)
4
+ enum_values = model.send(enum_name.to_s.pluralize).keys
5
+
6
+ Class.new(Types::BaseEnum) do
7
+ graphql_name(graphql_enum_name || "#{model.name}#{enum_name.to_s.camelize}Enum")
8
+
9
+ enum_values.each do |val|
10
+ value val, description: "#{val.titleize} #{enum_name}"
11
+ end
12
+ end
13
+ end
14
+
15
+ def self.enum_from_array(array, graphql_enum_name)
16
+ enum_values = array.map(&:to_s)
17
+
18
+ Class.new(Types::BaseEnum) do
19
+ graphql_name(graphql_enum_name)
20
+
21
+ enum_values.each do |val|
22
+ value val, description: val.titleize
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -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.7'
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,11 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cm-graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anbazhagan Palani
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
10
  date: 2022-09-14 00:00:00.000000000 Z
@@ -89,6 +88,7 @@ files:
89
88
  - app/graphql/mutations/base_mutation.rb
90
89
  - app/graphql/queries/base_query.rb
91
90
  - app/graphql/types/base_connection.rb
91
+ - app/graphql/types/enum_helpers.rb
92
92
  - app/graphql/types/enums/base/sort_column.rb
93
93
  - app/graphql/types/enums/base/sort_direction.rb
94
94
  - app/graphql/types/inputs/base/attachment.rb
@@ -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
@@ -117,7 +118,6 @@ homepage: https://github.com/commutatus/template-paging-api
117
118
  licenses:
118
119
  - MIT
119
120
  metadata: {}
120
- post_install_message:
121
121
  rdoc_options: []
122
122
  require_paths:
123
123
  - lib
@@ -132,8 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  requirements: []
135
- rubygems_version: 3.5.15
136
- signing_key:
135
+ rubygems_version: 3.6.9
137
136
  specification_version: 4
138
137
  summary: A gem to setup grapqhl basics like pagination, file upload
139
138
  test_files: []