graphql-models_connect 1.0.0 → 1.1.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 +6 -0
- data/README.md +2 -0
- data/graphql-models_connect.gemspec +32 -0
- data/lib/graphql/models_connect/dsl/graphql/schema/interface.rb +25 -0
- data/lib/graphql/models_connect/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4ca2f8e411e9bc8dc957d4a5572eb672d34b2d1d4a53cee64d247da720026e0
|
4
|
+
data.tar.gz: 4fdf99d8d66d3ae42c9bba5c7ed437f8cf0d2fe6f10b9adc6d6ded6e5cbeff6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62458c968b1103ccb50ead589f6639f50c6f501d273ca0a83dfe1e849bff3149ea796cdd5165f43bfaef93d3f78a6a02a3e5ad2338e51be750c5d6579e14ed82
|
7
|
+
data.tar.gz: f629f4392a2fcd64c1dd97ea841318ec3245e0f1b583cbebdb510c3a0c50ed8e5386c994ff2b90117d501515e4e93c1cfb6bedf2c269247620a60bb754394057
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -44,6 +44,8 @@ module Types
|
|
44
44
|
end
|
45
45
|
```
|
46
46
|
|
47
|
+
The same methods are defined for interfaces.
|
48
|
+
|
47
49
|
## Version numbers
|
48
50
|
|
49
51
|
GraphQL Models Connect loosely follows [Semantic Versioning](https://semver.org/), with a hard guarantee that breaking changes to the public API will always coincide with an increase to the `MAJOR` number.
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative 'lib/graphql/models_connect/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = 'graphql-models_connect'
|
5
|
+
spec.version = GraphQL::ModelsConnect::VERSION
|
6
|
+
spec.authors = ['Moku S.r.l.', 'Riccardo Agatea']
|
7
|
+
spec.email = ['info@moku.io']
|
8
|
+
spec.license = 'MIT'
|
9
|
+
|
10
|
+
spec.summary = 'Directly link GraphQL types to underlying models.'
|
11
|
+
spec.description = 'Directly link GraphQL types to underlying models.'
|
12
|
+
spec.homepage = 'https://github.com/moku-io/graphql-models_connect'
|
13
|
+
spec.required_ruby_version = '>= 3.0.0'
|
14
|
+
|
15
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
16
|
+
spec.metadata['source_code_uri'] = 'https://github.com/moku-io/graphql-models_connect'
|
17
|
+
spec.metadata['changelog_uri'] = 'https://github.com/moku-io/graphql-models_connect/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 'activesupport'
|
31
|
+
spec.add_dependency 'graphql', '~> 2.0'
|
32
|
+
end
|
@@ -0,0 +1,25 @@
|
|
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
|
12
|
+
|
13
|
+
def default_model_class
|
14
|
+
raise 'You must set an explicit model for anonymous graphql interfaces' if name.nil?
|
15
|
+
|
16
|
+
default_model_name = name.delete_suffix 'Type'
|
17
|
+
|
18
|
+
raise "No default model found for #{name}" unless const_defined? default_model_name
|
19
|
+
|
20
|
+
const_get default_model_name
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
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.
|
4
|
+
version: 1.1.0
|
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:
|
12
|
+
date: 2025-04-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -52,8 +52,10 @@ files:
|
|
52
52
|
- LICENSE
|
53
53
|
- README.md
|
54
54
|
- Rakefile
|
55
|
+
- graphql-models_connect.gemspec
|
55
56
|
- lib/graphql/models_connect.rb
|
56
57
|
- lib/graphql/models_connect/dsl.rb
|
58
|
+
- lib/graphql/models_connect/dsl/graphql/schema/interface.rb
|
57
59
|
- lib/graphql/models_connect/dsl/graphql/schema/object.rb
|
58
60
|
- lib/graphql/models_connect/version.rb
|
59
61
|
homepage: https://github.com/moku-io/graphql-models_connect
|
@@ -78,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
80
|
- !ruby/object:Gem::Version
|
79
81
|
version: '0'
|
80
82
|
requirements: []
|
81
|
-
rubygems_version: 3.5.
|
83
|
+
rubygems_version: 3.5.22
|
82
84
|
signing_key:
|
83
85
|
specification_version: 4
|
84
86
|
summary: Directly link GraphQL types to underlying models.
|