graphql-models_connect 1.1.0 → 1.1.2

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: d4ca2f8e411e9bc8dc957d4a5572eb672d34b2d1d4a53cee64d247da720026e0
4
- data.tar.gz: 4fdf99d8d66d3ae42c9bba5c7ed437f8cf0d2fe6f10b9adc6d6ded6e5cbeff6a
3
+ metadata.gz: 0cb97fc4846f4eb233fac17686332a39b30e552e332877f5054cd14194d7f28a
4
+ data.tar.gz: e5452a783b34ac3ab8840cdd7f3168e44867146f8a7ec55087d018dc9ed3ac31
5
5
  SHA512:
6
- metadata.gz: 62458c968b1103ccb50ead589f6639f50c6f501d273ca0a83dfe1e849bff3149ea796cdd5165f43bfaef93d3f78a6a02a3e5ad2338e51be750c5d6579e14ed82
7
- data.tar.gz: f629f4392a2fcd64c1dd97ea841318ec3245e0f1b583cbebdb510c3a0c50ed8e5386c994ff2b90117d501515e4e93c1cfb6bedf2c269247620a60bb754394057
6
+ metadata.gz: 1298138789be3639700ffa08b6e203bdb48547fb83eeab4ade3f7beb70a7fda9ab45173f544e2697a478ae86ca857c4c456f152f1f62c7616eba8235ce122161
7
+ data.tar.gz: 41683e4471d8786880700eb091794af32b05b5eebed840b65edf6f4d50fa4bd7bb8c6414af39e07275ddb334b75fc5eecf0f93d0c85166c2e26b3f750715935b
data/CHANGELOG.md CHANGED
@@ -8,6 +8,18 @@
8
8
  ### Bug fixes
9
9
  )-->
10
10
 
11
+ ## 1.1.2 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.1 2025-05-16
18
+
19
+ ### Bug fixes
20
+
21
+ - Using `definition_methods` broke something in newer versions of the `graphql` gem. We now use `ActiveSupport::Concern`.
22
+
11
23
  ## 1.1.0 2025-04-14
12
24
 
13
25
  ### New features
@@ -1,25 +1,23 @@
1
- module GraphQL
2
- class Schema
3
- module Interface
4
- definition_methods do
5
- def model_class new_model_class=nil
6
- if new_model_class.nil?
7
- @model_class ||= default_model_class
8
- else
9
- @model_class = new_model_class
10
- end
11
- end
1
+ require 'active_support/concern'
12
2
 
13
- def default_model_class
14
- raise 'You must set an explicit model for anonymous graphql interfaces' if name.nil?
3
+ monkey_patch = Module.new do
4
+ def model_class new_model_class=nil
5
+ if new_model_class.nil?
6
+ @model_class ||= default_model_class
7
+ else
8
+ @model_class = new_model_class
9
+ end
10
+ end
15
11
 
16
- default_model_name = name.delete_suffix 'Type'
12
+ def default_model_class
13
+ raise 'You must set an explicit model for anonymous graphql interfaces' if name.nil?
17
14
 
18
- raise "No default model found for #{name}" unless const_defined? default_model_name
15
+ default_model_name = name.delete_suffix 'Type'
19
16
 
20
- const_get default_model_name
21
- end
22
- end
23
- end
17
+ raise "No default model found for #{name}" unless const_defined? default_model_name
18
+
19
+ const_get default_model_name
24
20
  end
25
21
  end
22
+
23
+ GraphQL::Schema::Interface::DefinitionMethods.include monkey_patch
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module ModelsConnect
3
- VERSION = '1.1.0'
3
+ VERSION = '1.1.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-models_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
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-04-14 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: activesupport