graphql_rails 1.1.0 → 1.2.0
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/CHANGELOG.md +9 -0
- data/Gemfile.lock +8 -6
- data/graphql_rails.gemspec +1 -1
- data/lib/graphql_rails/controller/log_controller_action.rb +7 -2
- data/lib/graphql_rails/decorator/relation_decorator.rb +0 -4
- data/lib/graphql_rails/model/build_connection_type.rb +5 -1
- data/lib/graphql_rails/model/build_connection_type/count_items.rb +1 -1
- data/lib/graphql_rails/router/schema_builder.rb +10 -0
- data/lib/graphql_rails/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aab866d81cb8b70ef283c47914ea056c15eb07000b701414a42a7055fe1dabe1
|
4
|
+
data.tar.gz: 814a9189c63ffee28c8ab47c761b8740680da723669ea05d0d0e2256770b61d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99fe93c9a15507f4ebd0c1ec8667ddeac6b211342ca4df65b4a866fd3ba1dc34dd5661c4fba8317e4deea5241b9c52a2cb176e9d1dc0d9a57ec57d464f7e1dfa
|
7
|
+
data.tar.gz: db4a1d9fb7d4c9a20fb449a54ae5c27e784c39672052d5f95e0c7927801eaebe3c88c4899e8477da3d892c7ff420cdc29a15b3753cf6ec1e9c94c946f6c6de66
|
data/CHANGELOG.md
CHANGED
@@ -9,8 +9,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
9
9
|
|
10
10
|
* Added/Changed/Deprecated/Removed/Fixed/Security: YOUR CHANGE HERE
|
11
11
|
|
12
|
+
## [1.2.0](2021-02-15)
|
13
|
+
|
14
|
+
* Added/Changed/Deprecated/Removed/Fixed/Security: YOUR CHANGE HERE
|
15
|
+
|
12
16
|
* Added: `options` argument to model level attribute. Allows disabling automatic camelCase
|
13
17
|
* Fixed: methods with complex input arguments receives `Hash` instances instead of `GraphQL::Schema::InputObject`
|
18
|
+
* Fixed: Using `ActiveSupport::ParameterFilter` (Rails 6.1), if it is defined, instead of `ActionDispatch::Http::ParameterFilter`
|
19
|
+
* Changed: graphql version is now `1.12` which may require system-wide changes.
|
20
|
+
* Fixed: improved connection wrapper for pagination to work.
|
21
|
+
* Fixed: implementation of `total` field is no longer missing when using pagination.
|
22
|
+
|
14
23
|
|
15
24
|
## [1.0.0](2020-02-07)
|
16
25
|
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
graphql_rails (1.
|
4
|
+
graphql_rails (1.2.0)
|
5
5
|
activesupport (>= 4)
|
6
|
-
graphql (~> 1.
|
6
|
+
graphql (~> 1.12, >= 1.12.4)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -78,7 +78,7 @@ GEM
|
|
78
78
|
erubi (1.9.0)
|
79
79
|
globalid (0.4.2)
|
80
80
|
activesupport (>= 4.2.0)
|
81
|
-
graphql (1.
|
81
|
+
graphql (1.12.4)
|
82
82
|
i18n (1.8.5)
|
83
83
|
concurrent-ruby (~> 1.0)
|
84
84
|
json (2.3.1)
|
@@ -92,7 +92,7 @@ GEM
|
|
92
92
|
method_source (1.0.0)
|
93
93
|
mimemagic (0.3.5)
|
94
94
|
mini_mime (1.0.2)
|
95
|
-
mini_portile2 (2.
|
95
|
+
mini_portile2 (2.5.0)
|
96
96
|
minitest (5.14.2)
|
97
97
|
mongo (2.13.1)
|
98
98
|
bson (>= 4.8.2, < 5.0.0)
|
@@ -100,8 +100,9 @@ GEM
|
|
100
100
|
activemodel (>= 5.1, < 6.1)
|
101
101
|
mongo (>= 2.7.0, < 3.0.0)
|
102
102
|
nio4r (2.5.4)
|
103
|
-
nokogiri (1.
|
104
|
-
mini_portile2 (~> 2.
|
103
|
+
nokogiri (1.11.1)
|
104
|
+
mini_portile2 (~> 2.5.0)
|
105
|
+
racc (~> 1.4)
|
105
106
|
parallel (1.19.2)
|
106
107
|
parser (2.7.2.0)
|
107
108
|
ast (~> 2.4.1)
|
@@ -111,6 +112,7 @@ GEM
|
|
111
112
|
pry-byebug (3.9.0)
|
112
113
|
byebug (~> 11.0)
|
113
114
|
pry (~> 0.13.0)
|
115
|
+
racc (1.5.2)
|
114
116
|
rack (2.2.3)
|
115
117
|
rack-test (1.1.0)
|
116
118
|
rack (>= 1.0, < 3)
|
data/graphql_rails.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
|
-
spec.add_dependency 'graphql', '~> 1.
|
23
|
+
spec.add_dependency 'graphql', '~> 1.12', '>= 1.12.4'
|
24
24
|
spec.add_dependency 'activesupport', '>= 4'
|
25
25
|
|
26
26
|
spec.add_development_dependency 'bundler', '~> 2'
|
@@ -51,8 +51,7 @@ module GraphqlRails
|
|
51
51
|
params
|
52
52
|
else
|
53
53
|
filter_options = Rails.configuration.filter_parameters
|
54
|
-
|
55
|
-
parametter_filter.filter(params)
|
54
|
+
parameter_filter_class.new(filter_options).filter(params)
|
56
55
|
end
|
57
56
|
end
|
58
57
|
|
@@ -61,6 +60,12 @@ module GraphqlRails
|
|
61
60
|
|
62
61
|
Rails.application.config.filter_parameters || []
|
63
62
|
end
|
63
|
+
|
64
|
+
def parameter_filter_class
|
65
|
+
return ActiveSupport::ParameterFilter if Object.const_defined?('ActiveSupport::ParameterFilter')
|
66
|
+
|
67
|
+
ActionDispatch::Http::ParameterFilter
|
68
|
+
end
|
64
69
|
end
|
65
70
|
end
|
66
71
|
end
|
@@ -71,9 +71,5 @@ module GraphqlRails
|
|
71
71
|
self.class.new(decorator: decorator, relation: new_relation, decorator_args: decorator_args)
|
72
72
|
end
|
73
73
|
end
|
74
|
-
|
75
|
-
GraphQL::Relay::BaseConnection.register_connection_implementation(
|
76
|
-
RelationDecorator, GraphQL::Relay::RelationConnection
|
77
|
-
)
|
78
74
|
end
|
79
75
|
end
|
@@ -30,7 +30,11 @@ module GraphqlRails
|
|
30
30
|
graphql_name("#{type.graphql_name}Connection")
|
31
31
|
edge_type(edge_type)
|
32
32
|
|
33
|
-
field :total, Integer, null: false
|
33
|
+
field :total, Integer, null: false
|
34
|
+
|
35
|
+
def total
|
36
|
+
CountItems.call(self)
|
37
|
+
end
|
34
38
|
end
|
35
39
|
end
|
36
40
|
|
@@ -21,11 +21,21 @@ module GraphqlRails
|
|
21
21
|
raw = raw_actions
|
22
22
|
|
23
23
|
Class.new(GraphQL::Schema) do
|
24
|
+
connections.add(
|
25
|
+
GraphqlRails::Decorator::RelationDecorator,
|
26
|
+
GraphQL::Pagination::ActiveRecordRelationConnection
|
27
|
+
)
|
24
28
|
cursor_encoder(Router::PlainCursorEncoder)
|
25
29
|
raw.each { |action| send(action[:name], *action[:args], &action[:block]) }
|
26
30
|
|
27
31
|
query(query_type) if query_type
|
28
32
|
mutation(mutation_type) if mutation_type
|
33
|
+
|
34
|
+
def self.type_from_ast(*args)
|
35
|
+
type = super
|
36
|
+
|
37
|
+
type.respond_to?(:to_graphql) ? type.to_graphql : type
|
38
|
+
end
|
29
39
|
end
|
30
40
|
end
|
31
41
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Povilas Jurčys
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -16,20 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.12'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.
|
22
|
+
version: 1.12.4
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '1.
|
29
|
+
version: '1.12'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.
|
32
|
+
version: 1.12.4
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: activesupport
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,7 +128,7 @@ dependencies:
|
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '6'
|
131
|
-
description:
|
131
|
+
description:
|
132
132
|
email:
|
133
133
|
- po.jurcys@gmail.com
|
134
134
|
executables: []
|
@@ -232,7 +232,7 @@ homepage: https://github.com/samesystem/graphql_rails
|
|
232
232
|
licenses:
|
233
233
|
- MIT
|
234
234
|
metadata: {}
|
235
|
-
post_install_message:
|
235
|
+
post_install_message:
|
236
236
|
rdoc_options: []
|
237
237
|
require_paths:
|
238
238
|
- lib
|
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
248
|
version: '0'
|
249
249
|
requirements: []
|
250
250
|
rubygems_version: 3.1.2
|
251
|
-
signing_key:
|
251
|
+
signing_key:
|
252
252
|
specification_version: 4
|
253
253
|
summary: Rails style structure for GraphQL API.
|
254
254
|
test_files: []
|