graphql-autotest 0.2.0 → 0.3.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/.github/workflows/testing.yml +21 -0
- data/CHANGELOG.md +11 -2
- data/graphql-autotest.gemspec +1 -1
- data/lib/graphql/autotest/field.rb +11 -7
- data/lib/graphql/autotest/runner.rb +2 -4
- data/lib/graphql/autotest/version.rb +1 -1
- metadata +8 -7
- 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: 25aac96392b254d5969fad2135e532169c245583cd774a5d537698f679415a80
|
4
|
+
data.tar.gz: e4be93743afd18a7ddebcb1997d4084b4e9d28791a489ec8f5c296b4f5d42d44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec61ea7f08b15333765dc678001fcb86a9b20003551972b60f1341bedc0f364a65a133951d20405c1cdf170d51d646da02ed5d9e516e43c77fd56a0131e643f9
|
7
|
+
data.tar.gz: 81ca2a5ffca321104894d04d3211992201335584656a34ca8135bf205efcb5dee35633c78bb1c6c29fcbfd719e20621b306509ba77343997031d70c4a64d20fc
|
@@ -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", "2.7", "2.6", "2.5"]
|
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,9 +2,18 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
-
## 0.
|
5
|
+
## 0.3.0 (2023-07-14)
|
6
6
|
|
7
|
-
*
|
7
|
+
* [#15](https://github.com/bitjourney/graphql-autotest/pull/15): Migrating from Travis CI to GitHub Actions. (by @shimbaco)
|
8
|
+
* [#14](https://github.com/bitjourney/graphql-autotest/pull/14): Add support for field arguments. (by @takeyoda)
|
9
|
+
|
10
|
+
## 0.2.1 (2020-04-13)
|
11
|
+
|
12
|
+
* [#10](https://github.com/bitjourney/graphql-autotest/pull/10): Make `logger` argument of `GraphQL::Autotest::Runner` optional.
|
13
|
+
|
14
|
+
## 0.2.0 (2020-04-10)
|
15
|
+
|
16
|
+
* [#8](https://github.com/bitjourney/graphql-autotest/pull/8): `GraphQL::Autotest::Runner` receives `logger` keyword argument.
|
8
17
|
|
9
18
|
## 0.1.2 (2020-03-18)
|
10
19
|
|
data/graphql-autotest.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
|
15
15
|
spec.metadata["homepage_uri"] = spec.homepage
|
16
16
|
spec.metadata["source_code_uri"] = spec.homepage
|
17
|
-
|
17
|
+
spec.metadata["changelog_uri"] = "https://github.com/bitjourney/graphql-autotest/blob/master/CHANGELOG.md"
|
18
18
|
|
19
19
|
# Specify which files should be added to the gem when it is released.
|
20
20
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -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
|
@@ -9,7 +9,7 @@ module GraphQL
|
|
9
9
|
# @param arguments_fetcher [Proc] A proc receives a field and ancestors keyword argument, and it returns a Hash. The hash is passed to call the field.
|
10
10
|
# @param max_depth [Integer] Max query depth. It is recommended to specify to avoid too large query.
|
11
11
|
# @param skip_if [Proc] A proc receives a field and ancestors keyword argument, and it returns a boolean. If it returns ture, the field is skipped.
|
12
|
-
def initialize(schema:, context:, arguments_fetcher: ArgumentsFetcher::DEFAULT, max_depth: 10, skip_if: -> (_field, **) { false }, logger:)
|
12
|
+
def initialize(schema:, context:, arguments_fetcher: ArgumentsFetcher::DEFAULT, max_depth: 10, skip_if: -> (_field, **) { false }, logger: Logger.new(nil))
|
13
13
|
@schema = schema
|
14
14
|
@context = context
|
15
15
|
@arguments_fetcher = arguments_fetcher
|
@@ -30,9 +30,7 @@ module GraphQL
|
|
30
30
|
fields.each do |f|
|
31
31
|
q = f.to_query
|
32
32
|
|
33
|
-
|
34
|
-
logger.info "Running Query: #{f.name}"
|
35
|
-
end
|
33
|
+
logger.info "Running Query: #{f.name}"
|
36
34
|
|
37
35
|
result = if dry_run
|
38
36
|
{}
|
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.0
|
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-07-14 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
|
@@ -55,7 +55,8 @@ licenses:
|
|
55
55
|
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
60
|
rdoc_options: []
|
60
61
|
require_paths:
|
61
62
|
- lib
|
@@ -70,8 +71,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
71
|
- !ruby/object:Gem::Version
|
71
72
|
version: '0'
|
72
73
|
requirements: []
|
73
|
-
rubygems_version: 3.
|
74
|
-
signing_key:
|
74
|
+
rubygems_version: 3.4.10
|
75
|
+
signing_key:
|
75
76
|
specification_version: 4
|
76
77
|
summary: Test GraphQL queries automatically
|
77
78
|
test_files: []
|