graphql-batch 0.2.1 → 0.2.2

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
  SHA1:
3
- metadata.gz: 1d4f407789106fb06ee163d087ba8a0b018d0ff5
4
- data.tar.gz: 664413f4a7f4776b09d01dd66c23f1a18ab14bc6
3
+ metadata.gz: bfa918397c9799aca7a3ac30e4031c7f57ad472c
4
+ data.tar.gz: 540ea8eba74692bdf2e10cf1561e9d26b1cff52b
5
5
  SHA512:
6
- metadata.gz: 2fc7d6e9e916a0cc7a8e691529749c17b3d47bbdbeadca7b6633c4d9738a36d3ace33892554505e40bfa9ed9246a8d94021771fe276cc45a3bb6ac545eb2e183
7
- data.tar.gz: 9fc71751db85879738f84601692f27781a8207564a4e38f1ffa3981d57421df9322943b232925a8e4b3662b4f232d63e002f6b9cc983e148cb764a0db11c2e52
6
+ metadata.gz: 3ec623bdc6aa34b85246b338f2a61710f57e2d76b8a3c1b0f502848b2e89b8e54373958db073e48f52843dbdd95a10da07ef54767f50f1f86d9d51dae4ccd80f
7
+ data.tar.gz: 7f396d708a3a4d0fa96ce32db63d4788b442b0390b91baa97ab9972f02de39c8c0508ad91e64cd6fa964cb80e6268d6aeabb8d335b4e3ed95835e1f50f66a211
data/README.md CHANGED
@@ -90,6 +90,7 @@ resolve -> (obj, args, context) do
90
90
  results.reduce(&:+)
91
91
  end
92
92
  end
93
+ ```
93
94
 
94
95
  `.then` can optionally take two lambda arguments, the first of which is equivalent to passing a block to `.then`, and the second one handles exceptions. This can be used to provide a fallback
95
96
 
@@ -16,6 +16,10 @@ module GraphQL::Batch
16
16
  promises_by_key[key] ||= Promise.new
17
17
  end
18
18
 
19
+ def load_many(keys)
20
+ Promise.all(keys.map { |key| load(key) })
21
+ end
22
+
19
23
  def fulfill(key, value)
20
24
  promises_by_key[key].fulfill(value)
21
25
  end
@@ -1,5 +1,5 @@
1
1
  module Graphql
2
2
  module Batch
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-batch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Thacker-Smith
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-28 00:00:00.000000000 Z
11
+ date: 2016-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql