graphql-autotest 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 740cc08d68d9c0ec44023db0bac083b5881f5cfe480113da6c28dd7725697475
4
- data.tar.gz: eecbc76b18f0d19f57a6fe092e77a9921e38aff748853bbf1bb92772c9551c8e
3
+ metadata.gz: 02c7dc964968ddb2024c3120913c4276e03112ecdd2a5f563c10165e6afb92ed
4
+ data.tar.gz: 3d0e03c20e2575ff8d68e0a553428ee11333e07371616facf74e22f2580707ac
5
5
  SHA512:
6
- metadata.gz: 1163493f414ea24426796a94e2539bb7d9ead8f3cd5de9ecb945c0e09d03ed607e7f22cbff66d91829d06bbf0e32bd33955ce41f30ff7fc2971494c247fb01d4
7
- data.tar.gz: d45da2e983b4774f63f8bc4180e7e899c2d30900ee67916246c6bd822b943f587783b66dfeffa95290756dbad43c6c3401d80db9997c100cd47b7c0c2055590e
6
+ metadata.gz: f8281378f21b276b9db8e26f75a73db161841ea9feb6b2a63da46e2279fda5a1b5f227ba8e2f61a1285dfa8c2f87992330c30282c216c3775c031b156697c2d6
7
+ data.tar.gz: 66663b66fbf9a00fa4e2595ca4c8aa0291124c63c1cd8260d6e4a419031c0276bcd978bec60cef7a160037bf53bff3037c65091f88d5601ee2b5530fca0939bb
data/CHANGELOG.md ADDED
@@ -0,0 +1,19 @@
1
+ # Change log
2
+
3
+ ## master (unreleased)
4
+
5
+ ## 0.2.0
6
+
7
+ * `GraphQL::Autotest::Runner` receives `logger` keyword argument.
8
+
9
+ ## 0.1.2 (2020-03-18)
10
+
11
+ * Restrict `required_ruby_version` to Ruby 2.5.
12
+
13
+ ## 0.1.1 (2020-03-15)
14
+
15
+ * Fix interface of `GraphQL::Autotest::Field#to_query` for smoke testing.
16
+
17
+ ## 0.1.0 (2020-03-15)
18
+
19
+ * The first release!🎉
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  GraphQL::Autotest tests your GraphQL API with auto-generated queries.
4
4
 
5
+ ## Requirements
6
+
7
+ GraphQL::Autotest only supports Ruby 2.5 or higher
8
+
5
9
  ## Installation
6
10
 
7
11
  Add this line to your application's Gemfile:
@@ -1,20 +1,21 @@
1
1
  module GraphQL
2
2
  module Autotest
3
3
  class Runner
4
- attr_reader :schema, :context, :arguments_fetcher, :max_depth, :skip_if
5
- private :schema, :context, :arguments_fetcher, :max_depth, :skip_if
4
+ attr_reader :schema, :context, :arguments_fetcher, :max_depth, :skip_if, :logger
5
+ private :schema, :context, :arguments_fetcher, :max_depth, :skip_if, :logger
6
6
 
7
7
  # @param schema [Class<GraphQL::Schema>]
8
8
  # @param context [Hash] it passes to GraphQL::Schema.execute
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 })
12
+ def initialize(schema:, context:, arguments_fetcher: ArgumentsFetcher::DEFAULT, max_depth: 10, skip_if: -> (_field, **) { false }, logger:)
13
13
  @schema = schema
14
14
  @context = context
15
15
  @arguments_fetcher = arguments_fetcher
16
16
  @max_depth = max_depth
17
17
  @skip_if = skip_if
18
+ @logger = logger
18
19
  end
19
20
 
20
21
  def report(dry_run: false)
@@ -28,7 +29,11 @@ module GraphQL
28
29
  )
29
30
  fields.each do |f|
30
31
  q = f.to_query
31
-
32
+
33
+ if logger && logger.respond_to?(:info)
34
+ logger.info "Running Query: #{f.name}"
35
+ end
36
+
32
37
  result = if dry_run
33
38
  {}
34
39
  else
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Autotest
3
- VERSION = "0.1.2"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
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.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masataka Pocke Kuwabara
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-18 00:00:00.000000000 Z
11
+ date: 2020-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -33,6 +33,7 @@ extra_rdoc_files: []
33
33
  files:
34
34
  - ".gitignore"
35
35
  - ".travis.yml"
36
+ - CHANGELOG.md
36
37
  - Gemfile
37
38
  - LICENSE
38
39
  - README.md