graphql-batch 0.3.3 → 0.3.4
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/lib/graphql/batch.rb +6 -1
- data/lib/graphql/batch/loader.rb +1 -0
- data/lib/graphql/batch/setup_multiplex.rb +14 -0
- data/lib/graphql/batch/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c839447dcaacc5db8e6e16d95a30c2fc2db4e899
|
4
|
+
data.tar.gz: ca03f0ee057d56cd2311ef51df54de199baa53ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5b0461239a98c5aa53924f2c9a721bfe8d3fc7a59ae70d261255ecf3421b574fc44626d55c514b57b403368ca94c7e2714f37ca66cf324fbdc3ca69735ea8fc
|
7
|
+
data.tar.gz: abcf9f692f944ac758fa21d6bcd9929a1ceaa9edf8adb6c9c14e019c4c032445dc532cd564fca0010471b02f32903bbdcb13df4a8bae0adde74958bad11387a3
|
data/lib/graphql/batch.rb
CHANGED
@@ -20,7 +20,11 @@ module GraphQL
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.use(schema_defn)
|
23
|
-
|
23
|
+
if GraphQL::VERSION >= "1.6.0"
|
24
|
+
schema_defn.instrument(:multiplex, GraphQL::Batch::SetupMultiplex)
|
25
|
+
else
|
26
|
+
schema_defn.instrument(:query, GraphQL::Batch::Setup)
|
27
|
+
end
|
24
28
|
schema_defn.lazy_resolve(::Promise, :sync)
|
25
29
|
end
|
26
30
|
|
@@ -34,3 +38,4 @@ require_relative "batch/loader"
|
|
34
38
|
require_relative "batch/executor"
|
35
39
|
require_relative "batch/promise"
|
36
40
|
require_relative "batch/setup"
|
41
|
+
require_relative "batch/setup_multiplex"
|
data/lib/graphql/batch/loader.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
module GraphQL::Batch
|
2
|
+
module SetupMultiplex
|
3
|
+
extend self
|
4
|
+
|
5
|
+
def before_multiplex(multiplex)
|
6
|
+
raise NestedError if GraphQL::Batch::Executor.current
|
7
|
+
GraphQL::Batch::Executor.current = GraphQL::Batch::Executor.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def after_multiplex(multiplex)
|
11
|
+
GraphQL::Batch::Executor.current = nil
|
12
|
+
end
|
13
|
+
end
|
14
|
+
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.3.
|
4
|
+
version: 0.3.4
|
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: 2017-
|
11
|
+
date: 2017-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- lib/graphql/batch/mutation_execution_strategy.rb
|
125
125
|
- lib/graphql/batch/promise.rb
|
126
126
|
- lib/graphql/batch/setup.rb
|
127
|
+
- lib/graphql/batch/setup_multiplex.rb
|
127
128
|
- lib/graphql/batch/version.rb
|
128
129
|
homepage: https://github.com/Shopify/graphql-batch
|
129
130
|
licenses:
|