graphql-filters 1.1.3 → 1.1.5

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: 384e2aca53aa1fce190281c21041e66682616963ead8887c4a05c3586f1c9c98
4
- data.tar.gz: c4b48cd47c65fbe371e7e555c7bce2d2fd47c823da49e532af579c9d40df23ae
3
+ metadata.gz: e4c44c55c15ade9472e7683e8929ac05e69df73da70a670888ba6882799c336e
4
+ data.tar.gz: ca4865a5a2b629d531ef7e3ef93f899330be5cd0b3854f998fd8ff01d985afd9
5
5
  SHA512:
6
- metadata.gz: ebef1f3f13bc566f81ee84a522c74046eb601fd6e6d9d1b31804a7649857af719b78566acf0946173c6ae25ebfb53c114f4036883ea799719a86829a16e8e50a
7
- data.tar.gz: '038e7a8eeb8b8819567101aeb4bc573eb00322ac4ebf50722a27e1448b638f072d25874db78a1f42d8277d3837a6f7975ae0f1a2c22924344f63a77a9aa5b517'
6
+ metadata.gz: 4975b8a331db108674f279c08863382164ccc2df2e004bf435e8d6ee428a499ae7c2e963dca6c34876dd8f175843590ba1b7ca7ec6351c7d5ae5f1e39df9d2c2
7
+ data.tar.gz: 8ffcbcd8615883bc5a9f35757443006bc08debc157015f414724f4aff45b978de35adc8a8687575c12eb677f4183c1ce8b16e44d54fa8c2d5a3b8275ec234a2b
data/CHANGELOG.md CHANGED
@@ -8,6 +8,18 @@
8
8
  ### Bug fixes
9
9
  )-->
10
10
 
11
+ ## 1.1.5 2025-08-18
12
+
13
+ ### Bug fixes
14
+
15
+ - Using `class_methods` wasn't compatible with the inheritance mechanism of interfaces. Adding the methods to `DefinitionMethods` directly actually makes them available to interfaces as intended.
16
+
17
+ ## 1.1.4 2025-07-17
18
+
19
+ ### New features
20
+
21
+ - Added the `comparison_input_type` field option. It is for internal use only and *not part of the public API documented in the [README](README.md)*.
22
+
11
23
  ## 1.1.3 2025-05-21
12
24
 
13
25
  ### New features
@@ -14,7 +14,8 @@ monkey_patch = Module.new do
14
14
  enabled: true,
15
15
  attribute_name: :method_sym.to_proc,
16
16
  association_name: :method_sym.to_proc,
17
- filtered_type: ->(field){field.resolver ? field.resolver.filtered_type : field.type}
17
+ filtered_type: ->(field){field.resolver ? field.resolver.filtered_type : field.type},
18
+ comparison_input_type: nil
18
19
  }
19
20
  end
20
21
 
@@ -1,21 +1,17 @@
1
- require 'active_support/concern'
1
+ require_relative '../../../input_types/object_comparison_input_type'
2
2
 
3
3
  monkey_patch = Module.new do
4
- extend ActiveSupport::Concern
5
-
6
- class_methods do
7
- def comparison_input_type new_comparison_input_type=nil
8
- if new_comparison_input_type.present?
9
- @comparison_input_type = new_comparison_input_type
10
- else
11
- @comparison_input_type ||= get_comparison_input_type
12
- end
4
+ def comparison_input_type new_comparison_input_type=nil
5
+ if new_comparison_input_type.present?
6
+ @comparison_input_type = new_comparison_input_type
7
+ else
8
+ @comparison_input_type ||= get_comparison_input_type
13
9
  end
10
+ end
14
11
 
15
- def get_comparison_input_type(*)
16
- GraphQL::Filters::InputTypes::ObjectComparisonInputType[self]
17
- end
12
+ def get_comparison_input_type(*)
13
+ GraphQL::Filters::InputTypes::ObjectComparisonInputType[self]
18
14
  end
19
15
  end
20
16
 
21
- GraphQL::Schema::Interface.include monkey_patch
17
+ GraphQL::Schema::Interface::DefinitionMethods.include monkey_patch
@@ -13,13 +13,15 @@ module GraphQL
13
13
  define_singleton_method :own_arguments do |*args, **kwargs, &block|
14
14
  unless @loaded_fields_arguments
15
15
  object_type.fields.each_value do |field_object|
16
- next unless field_object.filter_options[:enabled]
17
-
18
- type = field_object.filter_options[:filtered_type]
19
16
  filter_options = field_object.filter_options
20
17
 
18
+ next unless filter_options[:enabled]
19
+
20
+ type = filter_options[:filtered_type]
21
+ comparison_input_type = filter_options[:comparison_input_type] || type.comparison_input_type
22
+
21
23
  argument field_object.name,
22
- type.comparison_input_type,
24
+ comparison_input_type,
23
25
  required: false,
24
26
  prepare: lambda { |field_comparator, _context|
25
27
  lambda { |scope|
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Filters
3
- VERSION = '1.1.3'.freeze
3
+ VERSION = '1.1.5'.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.1.3
4
+ version: 1.1.5
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: 2025-05-21 00:00:00.000000000 Z
12
+ date: 2025-08-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord