graphiti 1.10.2 → 1.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb69f1b503241f9a283e3a2d9a68eb3c3f8c29ec3f4589fa6cb15768bfc8f7f5
4
- data.tar.gz: 2301d27dbd072face4b392993b7eb7fb26777bde44d8040f33a4173e8ac35118
3
+ metadata.gz: 49e9d67548ea3c47b06b7a476124e54506a73736218fb9ed4ff89298f43fffd8
4
+ data.tar.gz: 5cbf075f809a25cf52b3e0db9c80562603bf64b9806aa4c19eee72f63bfc422b
5
5
  SHA512:
6
- metadata.gz: 132c6f094beec5643d08808d2ef6503982021eff67410540fc5d90b14f1339e823620fff4d25e06c846dac1760717218aa26174162c1ed775e4c9b0877bffc19
7
- data.tar.gz: d48f8895952b4774adb37302adf1891762afd7da6d28141ebe6951347f58368a431cd67502fac7a9b4c819e2713a8759b350686bba7236db027aa25602c2c428
6
+ metadata.gz: ea57e2be450016ac29ba83297f5fdabd4f39a2240d17441586e6b8ea800b8c3adf204a47e10d7fe806444ffbc05702339c0e02c606523621c1097df0a32330ba
7
+ data.tar.gz: c481af2971fe256dac0e4500c116743ae7261226b2a22b199eb503f8f9570a78c0e14ae21dbb6a0b2edaddad3059317e93f719670518ae75749493739e578d07
data/.gitignore CHANGED
@@ -7,6 +7,8 @@
7
7
  /spec/reports/
8
8
  /gemfiles/*.lock
9
9
  /tmp/
10
+ # railties generates local_secret.txt under the dummy app root, which is spec/
11
+ /spec/tmp/
10
12
  node_modules
11
13
  .byebug_history
12
14
  spec/.rspec-examples
data/Appraisals CHANGED
@@ -46,7 +46,8 @@ end
46
46
  appraise "rails-7-1" do
47
47
  gem "rails", "~> 7.1"
48
48
  gem "rspec-rails"
49
- gem "sqlite3", "~> 1.4.0"
49
+ # This appraisal is the ruby-head job; sqlite3 1.4.x cannot build on Ruby 4.x
50
+ gem "sqlite3", "~> 2.1"
50
51
  gem "database_cleaner"
51
52
  end
52
53
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  graphiti changelog
2
2
 
3
+ # [1.11.0](https://github.com/graphiti-api/graphiti/compare/v1.10.3...v1.11.0) (2026-07-28)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * filter instead of failing for nil string values ([#503](https://github.com/graphiti-api/graphiti/issues/503)) ([44bf76c](https://github.com/graphiti-api/graphiti/commit/44bf76c1d519f3d7bfa31f08e88dfcc61cc56455))
9
+
10
+
11
+ ### Features
12
+
13
+ * adds attr_reader to Graphiti::Errors::UnsupportedOperator ([#506](https://github.com/graphiti-api/graphiti/issues/506)) ([315cc30](https://github.com/graphiti-api/graphiti/commit/315cc30bad69485d7c5c5f02a0d515b67382281f))
14
+
15
+ ## [1.10.3](https://github.com/graphiti-api/graphiti/compare/v1.10.2...v1.10.3) (2026-07-28)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * declare ostruct runtime dependency for Ruby 3.5+ ([#508](https://github.com/graphiti-api/graphiti/issues/508)) ([38ef5c5](https://github.com/graphiti-api/graphiti/commit/38ef5c55b437b2cd42049405f8e98e991939b0fb))
21
+
3
22
  ## [1.10.2](https://github.com/graphiti-api/graphiti/compare/v1.10.1...v1.10.2) (2026-03-18)
4
23
 
5
24
 
@@ -4,7 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 7.1"
6
6
  gem "rspec-rails"
7
- gem "sqlite3", "~> 1.4.0"
7
+ gem "sqlite3", "~> 2.1"
8
8
  gem "database_cleaner"
9
9
 
10
10
  group :test do
data/graphiti.gemspec CHANGED
@@ -24,6 +24,8 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency "graphiti_errors", "~> 1.1.0"
25
25
  spec.add_dependency "concurrent-ruby", ">= 1.2", "< 2.0"
26
26
  spec.add_dependency "activesupport", ">= 5.2"
27
+ # Bundled (no longer default) as of Ruby 3.5; graphiti uses OpenStruct in lib/
28
+ spec.add_dependency "ostruct", ">= 0.5"
27
29
 
28
30
  spec.add_development_dependency "faraday", "~> 0.15"
29
31
  spec.add_development_dependency "kaminari", "~> 0.17"
@@ -41,22 +41,24 @@ module Graphiti
41
41
  alias_method :filter_enum_not_eql, :filter_not_eq
42
42
 
43
43
  def filter_string_eq(scope, attribute, value, is_not: false)
44
+ return filter_string_eql(scope, attribute, nil, is_not: is_not) if Array(value).compact.blank?
45
+
44
46
  column = column_for(scope, attribute)
45
47
  clause = column.lower.eq_any(value.map(&:downcase))
46
48
  is_not ? scope.where.not(clause) : scope.where(clause)
47
49
  end
48
50
 
49
51
  def filter_string_eql(scope, attribute, value, is_not: false)
50
- clause = {attribute => value}
52
+ clause = {attribute => value.presence}
51
53
  is_not ? scope.where.not(clause) : scope.where(clause)
52
54
  end
53
55
 
54
56
  def filter_string_not_eq(scope, attribute, value)
55
- filter_string_eq(scope, attribute, value, is_not: true)
57
+ filter_string_eq(scope, attribute, value.presence, is_not: true)
56
58
  end
57
59
 
58
60
  def filter_string_not_eql(scope, attribute, value)
59
- filter_string_eql(scope, attribute, value, is_not: true)
61
+ filter_string_eql(scope, attribute, value.presence, is_not: true)
60
62
  end
61
63
 
62
64
  # Arel has different match escaping behavior before rails 5.
@@ -97,6 +97,8 @@ module Graphiti
97
97
  end
98
98
 
99
99
  class UnsupportedOperator < Base
100
+ attr_reader :resource, :filter_name, :supported, :operator
101
+
100
102
  def initialize(resource, filter_name, supported, operator)
101
103
  @resource = resource
102
104
  @filter_name = filter_name
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "1.10.2"
2
+ VERSION = "1.11.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.2
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-18 00:00:00.000000000 Z
11
+ date: 2026-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonapi-serializable
@@ -112,6 +112,20 @@ dependencies:
112
112
  - - ">="
113
113
  - !ruby/object:Gem::Version
114
114
  version: '5.2'
115
+ - !ruby/object:Gem::Dependency
116
+ name: ostruct
117
+ requirement: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0.5'
122
+ type: :runtime
123
+ prerelease: false
124
+ version_requirements: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0.5'
115
129
  - !ruby/object:Gem::Dependency
116
130
  name: faraday
117
131
  requirement: !ruby/object:Gem::Requirement