graphql-filters 1.0.4 → 1.0.6

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: 2de1ec0e63619e14566194c02827c05f3b593d1a032ab2a885ab2735fd2adf81
4
- data.tar.gz: d26182e54ec5bdf0fa8eef48d31d76dd429827e7ac68e6cc2614fd25d1f3f99c
3
+ metadata.gz: 063e179dd5b139ff1c59b282a88ae4e1fd8bad1d413a0cd1886453110a61c9e4
4
+ data.tar.gz: '0838ffddd943f201cd37376b802b81e53ccc21e3a8e5e48b23555adf82486022'
5
5
  SHA512:
6
- metadata.gz: 45e8caf0669fc4eba7a2731f19104177610692a526799b57d55c8c4b3d97aaf849e8c3162e6a7f7ea0af9be816102e61a3332d1a6f65394d6ef56e1fa287d448
7
- data.tar.gz: c348559d4851966e5227f249f95d5bcfcf6a3bf9cc3f567d80f0ff41ca87dcab2c8f0f139ac96c76cf1da903cb0856ee5c8e035f99e40dc8864e0fdac60cc794
6
+ metadata.gz: 4bde612cd1a2abb71fce833e6aa7e0e8562c2ce2f5aa9127587e1d23c8a7fde6f85376bf0b93511026c494b85691404f2640ab7c50d8fb8397ec2add27a974b3
7
+ data.tar.gz: 7ac26f7f7afedc105b8415d344147d0fa9e44f40ad6d7dbc8236d7bce27fc0bb5d466b1cf3561dc9a540f1fc4e68601185ae12ba76af78d82232dd4e968b5ddd
data/CHANGELOG.md CHANGED
@@ -8,6 +8,18 @@
8
8
  ### Bug fixes
9
9
  )-->
10
10
 
11
+ ## 1.0.6 2025-01-17
12
+
13
+ ### Bug fixes
14
+
15
+ - Fix `NoMethodError` when using `Filterable` without `SearchObject` and not passing a filter.
16
+
17
+ ## 1.0.5 2024-11-29
18
+
19
+ ### Bug fixes
20
+
21
+ - Fixed an internal bug in resolution of the filtered type for a resolver.
22
+
11
23
  ## 1.0.4 2024-10-14
12
24
 
13
25
  ### New features
@@ -0,0 +1,34 @@
1
+ require_relative 'lib/graphql/filters/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = 'graphql-filters'
5
+ spec.version = GraphQL::Filters::VERSION
6
+ spec.authors = ['Moku S.r.l.', 'Riccardo Agatea']
7
+ spec.email = ['info@moku.io']
8
+ spec.license = 'MIT'
9
+
10
+ spec.summary = 'Provide a fully typed interface to filter lists in a GraphQL API.'
11
+ spec.description = 'Provide a fully typed interface to filter lists in a GraphQL API.'
12
+ spec.homepage = 'https://github.com/moku-io/graphql-filters'
13
+ spec.required_ruby_version = '>= 3.0.0' # Maybe we should check (?)
14
+
15
+ spec.metadata['homepage_uri'] = spec.homepage
16
+ spec.metadata['source_code_uri'] = 'https://github.com/moku-io/graphql-filters'
17
+ spec.metadata['changelog_uri'] = 'https://github.com/moku-io/graphql-filters/blob/master/CHANGELOG.md'
18
+
19
+ # Specify which files should be added to the gem when it is released.
20
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
+ spec.files = Dir.chdir File.expand_path(__dir__) do
22
+ `git ls-files -z`.split("\x0").reject do |f|
23
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
24
+ end
25
+ end
26
+ spec.bindir = 'exe'
27
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ['lib']
29
+
30
+ spec.add_dependency 'activerecord'
31
+ spec.add_dependency 'activesupport'
32
+ spec.add_dependency 'graphql', '~> 2.0.0'
33
+ spec.add_dependency 'graphql-models_connect'
34
+ end
@@ -16,7 +16,7 @@ module GraphQL
16
16
  end
17
17
 
18
18
  inner_type = filtered_type
19
- inner_type = filtered_type.of_type until inner_type.kind == GraphQL::TypeKinds::LIST
19
+ inner_type = inner_type.of_type until inner_type.kind == GraphQL::TypeKinds::LIST
20
20
  inner_type = inner_type.of_type
21
21
 
22
22
  option :filter, type: inner_type.comparison_input_type do |scope, filter|
@@ -28,13 +28,13 @@ module GraphQL
28
28
  raise 'You can only apply a filter to a list field' unless filtered_type.list?
29
29
 
30
30
  inner_type = filtered_type
31
- inner_type = filtered_type.of_type while inner_type.kind == GraphQL::TypeKinds::LIST
31
+ inner_type = inner_type.of_type while inner_type.kind == GraphQL::TypeKinds::LIST
32
32
  inner_type = inner_type.of_type
33
33
 
34
34
  argument :filter, inner_type.comparison_input_type, required: false
35
35
 
36
36
  def resolve filter: nil, **kwargs
37
- filter.call super(**kwargs)
37
+ filter ? filter.call(super(**kwargs)) : super(**kwargs)
38
38
  end
39
39
  end
40
40
  end
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Filters
3
- VERSION = '1.0.4'.freeze
3
+ VERSION = '1.0.6'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-filters
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moku S.r.l.
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-10-14 00:00:00.000000000 Z
12
+ date: 2025-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -81,6 +81,7 @@ files:
81
81
  - LICENSE
82
82
  - README.md
83
83
  - Rakefile
84
+ - graphql-filters.gemspec
84
85
  - lib/graphql/filters.rb
85
86
  - lib/graphql/filters/activerecord_patch.rb
86
87
  - lib/graphql/filters/activerecord_patch/arel/nodes/contained.rb
@@ -130,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
131
  - !ruby/object:Gem::Version
131
132
  version: '0'
132
133
  requirements: []
133
- rubygems_version: 3.5.11
134
+ rubygems_version: 3.5.22
134
135
  signing_key:
135
136
  specification_version: 4
136
137
  summary: Provide a fully typed interface to filter lists in a GraphQL API.