dry-graphql 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +24 -15
- data/.tool-versions +1 -1
- data/dry-graphql.gemspec +1 -1
- data/lib/dry/graphql.rb +5 -3
- data/lib/dry/graphql/schema_builder.rb +2 -1
- data/lib/dry/graphql/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2124318d8818531de31fe21228da4c8f507cfe388f0301ab78905db000f0c632
|
4
|
+
data.tar.gz: 3876ae80d5a2e16e37efca47466dc5316e00effc731273b16418298628e55b04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70729f20ad5bb6064c612652a04cdc6aa55189caf126cb863b8d8b308584026cb920afaab60ea7510c7274cd3d8529c37ccfb8510f9d246af8e8eb55fa1628db
|
7
|
+
data.tar.gz: 2ba16d09e38b8b63bc05e5d02fade862228ce1ba611e46cc0f8544c00cd9228c831a01f07441845fd7782d107108439e24b59509b2dc2d41b2f9591ecd59d6d8
|
data/.rubocop_todo.yml
CHANGED
@@ -1,39 +1,48 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2021-06-10 20:11:40 UTC using RuboCop version 1.16.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: Include.
|
11
|
+
# Include: **/*.gemspec
|
12
|
+
Gemspec/RequiredRubyVersion:
|
13
|
+
Exclude:
|
14
|
+
- 'dry-graphql.gemspec'
|
15
|
+
|
16
|
+
# Offense count: 2
|
17
|
+
# Configuration parameters: AllowedMethods.
|
18
|
+
# AllowedMethods: enums
|
19
|
+
Lint/ConstantDefinitionInBlock:
|
20
|
+
Exclude:
|
21
|
+
- 'spec/dry/graphql_spec.rb'
|
22
|
+
|
23
|
+
# Offense count: 2
|
24
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
10
25
|
Metrics/AbcSize:
|
11
|
-
Max:
|
26
|
+
Max: 45
|
12
27
|
|
13
28
|
# Offense count: 1
|
14
|
-
# Configuration parameters: CountComments.
|
29
|
+
# Configuration parameters: CountComments, CountAsOne.
|
15
30
|
Metrics/ClassLength:
|
16
31
|
Max: 151
|
17
32
|
|
18
|
-
# Offense count:
|
33
|
+
# Offense count: 1
|
34
|
+
# Configuration parameters: IgnoredMethods.
|
19
35
|
Metrics/CyclomaticComplexity:
|
20
|
-
Max:
|
36
|
+
Max: 15
|
21
37
|
|
22
38
|
# Offense count: 2
|
23
|
-
# Configuration parameters: CountComments, ExcludedMethods.
|
39
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
24
40
|
Metrics/MethodLength:
|
25
41
|
Max: 12
|
26
42
|
|
27
43
|
# Offense count: 1
|
28
|
-
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
44
|
+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
29
45
|
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
30
46
|
Naming/FileName:
|
31
47
|
Exclude:
|
32
48
|
- 'lib/dry-graphql.rb'
|
33
|
-
|
34
|
-
# Offense count: 17
|
35
|
-
# Cop supports --auto-correct.
|
36
|
-
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
37
|
-
# URISchemes: http, https
|
38
|
-
Metrics/LineLength:
|
39
|
-
Max: 105
|
data/.tool-versions
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby 2.
|
1
|
+
ruby 2.7.2
|
data/dry-graphql.gemspec
CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.add_runtime_dependency 'graphql', '~> 1.10'
|
39
39
|
|
40
40
|
spec.add_development_dependency 'appraisal'
|
41
|
-
spec.add_development_dependency 'bundler', '~>
|
41
|
+
spec.add_development_dependency 'bundler', '~> 2.2.16'
|
42
42
|
spec.add_development_dependency 'rake', '~> 10.0'
|
43
43
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
44
44
|
end
|
data/lib/dry/graphql.rb
CHANGED
@@ -8,8 +8,10 @@ module Dry
|
|
8
8
|
# Module containing GraphQL enhancements
|
9
9
|
module GraphQL
|
10
10
|
# Generates a graphql_name from a class name
|
11
|
-
def self.generate_graphql_name(
|
12
|
-
|
11
|
+
def self.generate_graphql_name(obj)
|
12
|
+
return obj.graphql_name if obj.respond_to?(:graphql_name)
|
13
|
+
|
14
|
+
obj.name.to_s.capitalize.gsub('DryGraphQLGeneratedTypeForUser', '').gsub('::', '__')
|
13
15
|
end
|
14
16
|
|
15
17
|
# Extends Dry::Struct functionality
|
@@ -17,7 +19,7 @@ module Dry
|
|
17
19
|
def graphql_type(options = {})
|
18
20
|
return @graphql_type if @graphql_type
|
19
21
|
|
20
|
-
graphql_name = Dry::GraphQL.generate_graphql_name(
|
22
|
+
graphql_name = Dry::GraphQL.generate_graphql_name(self)
|
21
23
|
graphql_schema = SchemaBuilder.build_graphql_schema_class(name)
|
22
24
|
graphql_schema.graphql_name(graphql_name)
|
23
25
|
schema_hash = schema.each_with_object({}) do |type, memo|
|
@@ -17,6 +17,7 @@ module Dry
|
|
17
17
|
attr_reader :field, :type, :options, :schema, :name, :parent
|
18
18
|
|
19
19
|
class TypeMappingError < StandardError; end
|
20
|
+
|
20
21
|
class NameGenerationError < StandardError; end
|
21
22
|
|
22
23
|
def initialize(name: nil, type: nil, schema: nil, parent: nil, options: {})
|
@@ -183,7 +184,7 @@ module Dry
|
|
183
184
|
loop do
|
184
185
|
break if cursor.nil?
|
185
186
|
|
186
|
-
sanitized_name = Dry::GraphQL.generate_graphql_name(cursor
|
187
|
+
sanitized_name = Dry::GraphQL.generate_graphql_name(cursor)
|
187
188
|
name_tree.unshift(sanitized_name)
|
188
189
|
cursor = cursor.parent
|
189
190
|
end
|
data/lib/dry/graphql/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Ker-Seymer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 2.2.16
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 2.2.16
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,7 +152,7 @@ homepage: https://github.com/adhawk/dry-graphql
|
|
152
152
|
licenses:
|
153
153
|
- MIT
|
154
154
|
metadata: {}
|
155
|
-
post_install_message:
|
155
|
+
post_install_message:
|
156
156
|
rdoc_options: []
|
157
157
|
require_paths:
|
158
158
|
- lib
|
@@ -167,8 +167,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
- !ruby/object:Gem::Version
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
|
-
rubygems_version: 3.
|
171
|
-
signing_key:
|
170
|
+
rubygems_version: 3.1.4
|
171
|
+
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: Integrate dry-types/dry-struct with graphql-ruby
|
174
174
|
test_files: []
|