graphql-autotest 0.2.1 → 0.3.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/.github/workflows/testing.yml +21 -0
- data/CHANGELOG.md +8 -0
- data/README.md +1 -2
- data/graphql-autotest.gemspec +1 -1
- data/lib/graphql/autotest/field.rb +11 -7
- data/lib/graphql/autotest/query_generator.rb +9 -0
- data/lib/graphql/autotest/version.rb +1 -1
- metadata +8 -8
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c76704c02a622e68997de0e5d1590255ef2da26118e7f9b748435d51015d8d1b
|
4
|
+
data.tar.gz: 90dcbd915e810f0a4ae85431093a23c04273cc234951cdc4a440f93a896e55f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95a8f8472f45dec9116afa15d554402d085d0ce359dfaf0d70f6f64611c3c2302beeecde31ff2824f1e3cf0b78ffd21163521c787c365bececfe961d6ef463ff
|
7
|
+
data.tar.gz: 11e8d653043ed3f498602b2f197408758b1630c8ef314bd5fefaae1132f77fafaa0b0e0fd7e23a39e2d9c62c4642450d889d71fe6253fa0565a993b1ad7db594
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: Testing
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
pull_request:
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
test:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
strategy:
|
11
|
+
fail-fast: false
|
12
|
+
matrix:
|
13
|
+
ruby: ["3.2", "3.1", "3.0"]
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v3
|
16
|
+
- uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: ${{ matrix.ruby }}
|
19
|
+
bundler-cache: true
|
20
|
+
- run: bundle install
|
21
|
+
- run: bundle exec rake test
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
* [#19](https://github.com/bitjourney/graphql-autotest/pull/19): Drop ruby version 2.5, 2.6, 2.7. (by @kuroponzu)
|
6
|
+
* [#18](https://github.com/bitjourney/graphql-autotest/pull/18): Support Interface. (by @hanachin)
|
7
|
+
|
8
|
+
## 0.3.0 (2023-07-14)
|
9
|
+
|
10
|
+
* [#15](https://github.com/bitjourney/graphql-autotest/pull/15): Migrating from Travis CI to GitHub Actions. (by @shimbaco)
|
11
|
+
* [#14](https://github.com/bitjourney/graphql-autotest/pull/14): Add support for field arguments. (by @takeyoda)
|
12
|
+
|
5
13
|
## 0.2.1 (2020-04-13)
|
6
14
|
|
7
15
|
* [#10](https://github.com/bitjourney/graphql-autotest/pull/10): Make `logger` argument of `GraphQL::Autotest::Runner` optional.
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ GraphQL::Autotest tests your GraphQL API with auto-generated queries.
|
|
4
4
|
|
5
5
|
## Requirements
|
6
6
|
|
7
|
-
GraphQL::Autotest only supports Ruby
|
7
|
+
GraphQL::Autotest only supports Ruby 3.0 or higher
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -133,4 +133,3 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
133
133
|
## Contributing
|
134
134
|
|
135
135
|
Bug reports and pull requests are welcome on GitHub at https://github.com/bitjourney/graphql-autotest.
|
136
|
-
|
data/graphql-autotest.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.summary = %q{Test GraphQL queries automatically}
|
10
10
|
spec.description = %q{Test GraphQL queries automatically}
|
11
11
|
spec.homepage = "https://github.com/bitjourney/graphql-autotest"
|
12
|
-
spec.required_ruby_version = Gem::Requirement.new(">=
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
|
13
13
|
spec.license = 'MIT'
|
14
14
|
|
15
15
|
spec.metadata["homepage_uri"] = spec.homepage
|
@@ -16,13 +16,17 @@ module GraphQL
|
|
16
16
|
end
|
17
17
|
|
18
18
|
private def _to_query
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
if children
|
20
|
+
<<~GRAPHQL
|
21
|
+
#{name}#{arguments_to_query} {
|
22
|
+
#{indent(children_to_query, 2)}
|
23
|
+
}
|
24
|
+
GRAPHQL
|
25
|
+
elsif arguments && arguments.size > 0
|
26
|
+
"#{name}#{arguments_to_query}"
|
27
|
+
else
|
28
|
+
name
|
29
|
+
end
|
26
30
|
end
|
27
31
|
|
28
32
|
private def children_to_query
|
@@ -57,6 +57,15 @@ module GraphQL
|
|
57
57
|
Field.new(name: "... on #{t.name}", children: children)
|
58
58
|
end
|
59
59
|
Field.new(name: f.name, children: possible_types + [Field::TYPE_NAME], arguments: arguments)
|
60
|
+
when GraphQL::Language::Nodes::InterfaceTypeDefinition
|
61
|
+
implementations = document.definitions.map do |td|
|
62
|
+
if td.respond_to?(:interfaces) && td.interfaces.any? { |i| i.name == field_type_def.name }
|
63
|
+
children = testable_fields(td, called_fields: called_fields.dup, depth: depth + 1, ancestors: [f, *ancestors])
|
64
|
+
Field.new(name: "... on #{td.name}", children: children)
|
65
|
+
end
|
66
|
+
end.compact
|
67
|
+
children = testable_fields(field_type_def, called_fields: called_fields.dup, depth: depth + 1, ancestors: [f, *ancestors])
|
68
|
+
Field.new(name: f.name, children: children + implementations, arguments: arguments)
|
60
69
|
else
|
61
70
|
children = testable_fields(field_type_def, called_fields: called_fields.dup, depth: depth + 1, ancestors: [f, *ancestors])
|
62
71
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-autotest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masataka Pocke Kuwabara
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -31,8 +31,8 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
+
- ".github/workflows/testing.yml"
|
34
35
|
- ".gitignore"
|
35
|
-
- ".travis.yml"
|
36
36
|
- CHANGELOG.md
|
37
37
|
- Gemfile
|
38
38
|
- LICENSE
|
@@ -56,7 +56,7 @@ metadata:
|
|
56
56
|
homepage_uri: https://github.com/bitjourney/graphql-autotest
|
57
57
|
source_code_uri: https://github.com/bitjourney/graphql-autotest
|
58
58
|
changelog_uri: https://github.com/bitjourney/graphql-autotest/blob/master/CHANGELOG.md
|
59
|
-
post_install_message:
|
59
|
+
post_install_message:
|
60
60
|
rdoc_options: []
|
61
61
|
require_paths:
|
62
62
|
- lib
|
@@ -64,15 +64,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
64
64
|
requirements:
|
65
65
|
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
67
|
+
version: 3.0.0
|
68
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
70
|
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0'
|
73
73
|
requirements: []
|
74
|
-
rubygems_version: 3.2.
|
75
|
-
signing_key:
|
74
|
+
rubygems_version: 3.2.33
|
75
|
+
signing_key:
|
76
76
|
specification_version: 4
|
77
77
|
summary: Test GraphQL queries automatically
|
78
78
|
test_files: []
|