rspec-graphql_types 1.0.8 → 2.0.1
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/Gemfile.lock +17 -13
- data/lib/rspec/graphql_types/version.rb +1 -1
- data/lib/rspec/graphql_types.rb +8 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22d9e66cd7761a19709f9f32ef0aad38b2b00a0c24e587fd57ab3b4d22923167
|
4
|
+
data.tar.gz: 7a362dde144c6af914e0a2f1ad9ab845c075e5a252f1c731ced16523789ebd8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dad94deac92ef621566d51f1ff242dedeedc5574ff27b2863ab8e6cee127b7b95352bb49241128aaa79c749a75b899bae056ef12881a8113b11c82da1a74e4a
|
7
|
+
data.tar.gz: 5f640f71a20a8fa036a5c9a569b5bd350c85dfc141434662d5c6778473b403350ab57148905aa659e8f89be0b4d6ad3d7cc58762bbd01ede4d0da29b00b570be
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rspec-graphql_types (
|
4
|
+
rspec-graphql_types (2.0.1)
|
5
5
|
activesupport
|
6
6
|
graphql
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (7.2.1
|
11
|
+
activesupport (7.2.2.1)
|
12
12
|
base64
|
13
|
+
benchmark (>= 0.3)
|
13
14
|
bigdecimal
|
14
15
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
15
16
|
connection_pool (>= 2.2.5)
|
@@ -19,20 +20,22 @@ GEM
|
|
19
20
|
minitest (>= 5.1)
|
20
21
|
securerandom (>= 0.3)
|
21
22
|
tzinfo (~> 2.0, >= 2.0.5)
|
22
|
-
base64 (0.
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
base64 (0.3.0)
|
24
|
+
benchmark (0.4.1)
|
25
|
+
bigdecimal (3.2.2)
|
26
|
+
concurrent-ruby (1.3.5)
|
27
|
+
connection_pool (2.5.3)
|
26
28
|
diff-lcs (1.4.4)
|
27
|
-
drb (2.2.
|
28
|
-
fiber-storage (1.0.
|
29
|
-
graphql (2.
|
29
|
+
drb (2.2.3)
|
30
|
+
fiber-storage (1.0.1)
|
31
|
+
graphql (2.5.9)
|
30
32
|
base64
|
31
33
|
fiber-storage
|
32
|
-
|
34
|
+
logger
|
35
|
+
i18n (1.14.7)
|
33
36
|
concurrent-ruby (~> 1.0)
|
34
|
-
logger (1.
|
35
|
-
minitest (5.25.
|
37
|
+
logger (1.7.0)
|
38
|
+
minitest (5.25.5)
|
36
39
|
rake (13.0.3)
|
37
40
|
rspec (3.10.0)
|
38
41
|
rspec-core (~> 3.10.0)
|
@@ -47,13 +50,14 @@ GEM
|
|
47
50
|
diff-lcs (>= 1.2.0, < 2.0)
|
48
51
|
rspec-support (~> 3.10.0)
|
49
52
|
rspec-support (3.10.2)
|
50
|
-
securerandom (0.
|
53
|
+
securerandom (0.4.1)
|
51
54
|
tzinfo (2.0.6)
|
52
55
|
concurrent-ruby (~> 1.0)
|
53
56
|
|
54
57
|
PLATFORMS
|
55
58
|
arm64-darwin-20
|
56
59
|
arm64-darwin-23
|
60
|
+
arm64-darwin-24
|
57
61
|
x86_64-darwin-20
|
58
62
|
|
59
63
|
DEPENDENCIES
|
data/lib/rspec/graphql_types.rb
CHANGED
@@ -8,11 +8,11 @@ module Rspec
|
|
8
8
|
module GraphQLTypes
|
9
9
|
extend ActiveSupport::Concern
|
10
10
|
|
11
|
-
class TestQuery < ::GraphQL::Query
|
11
|
+
class TestQuery < ::GraphQL::Query
|
12
12
|
attr_reader :context, :schema, :multiplex
|
13
13
|
|
14
14
|
def initialize(context:, schema:)
|
15
|
-
super()
|
15
|
+
super(schema, context: context)
|
16
16
|
@context = context
|
17
17
|
@schema = schema
|
18
18
|
@multiplex = false
|
@@ -27,7 +27,7 @@ module Rspec
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def warden
|
30
|
-
@warden ||= ::GraphQL::
|
30
|
+
@warden ||= ::GraphQL::Schema::Warden.new(
|
31
31
|
::GraphQL::Filter.new,
|
32
32
|
context: context,
|
33
33
|
schema: schema
|
@@ -40,7 +40,7 @@ module Rspec
|
|
40
40
|
let(:schema) { ::GraphQL::VERSION.start_with?("1") ? GraphQLTypes.schema_class.new : GraphQLTypes.schema_class }
|
41
41
|
let(:context) {
|
42
42
|
::GraphQL::Query::Context.new(
|
43
|
-
query: TestQuery.new(context:
|
43
|
+
query: TestQuery.new(context: GraphQL::Query::Context.new(query: nil, values: {}, object: nil, schema: schema), schema: schema),
|
44
44
|
values: context_values,
|
45
45
|
object: nil,
|
46
46
|
schema: schema
|
@@ -76,6 +76,9 @@ module Rspec
|
|
76
76
|
value.map { |v| graphql_object(type.of_type, v) }
|
77
77
|
when 'ENUM'
|
78
78
|
type.coerce_result(value, context)
|
79
|
+
when 'INTERFACE'
|
80
|
+
subtype = type.resolve_type(value, context)
|
81
|
+
graphql_object(subtype, value)
|
79
82
|
else
|
80
83
|
raise "Unknown type kind #{type.kind.name}"
|
81
84
|
end
|
@@ -116,7 +119,7 @@ module Rspec
|
|
116
119
|
def self.find_graphql_schema
|
117
120
|
::GraphQL::Schema.subclasses
|
118
121
|
.filter { |schema| !schema.name&.start_with?("GraphQL::") }
|
119
|
-
.filter { |schema| !schema.name&.
|
122
|
+
.filter { |schema| !schema.name&.end_with?("::SCHEMA") }
|
120
123
|
end
|
121
124
|
end
|
122
125
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-graphql_types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tejas Dinkar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
|
-
rubygems_version: 3.3.
|
85
|
+
rubygems_version: 3.3.7
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Test out types in ruby graphql
|