graphql 1.8.16 → 1.8.17

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: 7f4d75bb1ea6eb12f5814da9719c227454eadcc8
4
- data.tar.gz: f3ab29dd3c80df1c3e6f45333091b7c4fd10704b
3
+ metadata.gz: e2cf356f246374526f5fca1394326715e96ebc5e
4
+ data.tar.gz: 9fce5c14aa470be59a4321107c3d3ac91b1b822d
5
5
  SHA512:
6
- metadata.gz: 7b442d84b06e04bf31e37fc8e6c4dc43e012b8add20ed792ba58e5737fd7ca4c17d228c8ae3ba95f63c15c7a40fdbbb9d5a268b3881a1edc134c0f7bbe5a3008
7
- data.tar.gz: 2cb99bdec864ecb123bc4c327ace9de30f1094c9664fb0c7ef96e80f2b9773081e172ef5a70a9df34e9e1a395958634cc34b8c26c8c0d451e9986e99965301b4
6
+ metadata.gz: 7c8c31bfc50559e7c3b167b504babdcf6a3e6aaa91e02e7f30b50eb9e964937c313a3e74300eb24b9a3c7edf6a195ce84f3a39c5a4efb3ae20428d8c65e37559
7
+ data.tar.gz: 24788f360761ad47b508f7ae1267a0825fc99e0ba4c81457c1c73b56e7f6e144e51c33e1c33a65a8bc424c95575af280bb8e3177608e730018e426b6097ba84a
@@ -1065,7 +1065,14 @@ module GraphQL
1065
1065
  # @param ctx [GraphQL::Query::Context] the context for this query
1066
1066
  # @return [Object] A GraphQL-ready (non-lazy) object
1067
1067
  def self.sync_lazy(value)
1068
- yield(value)
1068
+ if block_given?
1069
+ # This was already hit by the instance, just give it back
1070
+ yield(value)
1071
+ else
1072
+ # This was called directly on the class, hit the instance
1073
+ # which has the lazy method map
1074
+ self.graphql_definition.sync_lazy(value)
1075
+ end
1069
1076
  end
1070
1077
 
1071
1078
  # @see Schema.sync_lazy for a hook to override
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "1.8.16"
3
+ VERSION = "1.8.17"
4
4
  end
@@ -10,6 +10,13 @@ describe GraphQL::Execution::Lazy do
10
10
  assert_equal 3, res["data"]["int"]
11
11
  end
12
12
 
13
+ it "Works with Query.new" do
14
+ query_str = '{ int(value: 2, plus: 1) }'
15
+ query = GraphQL::Query.new(LazyHelpers::LazySchema, query_str)
16
+ res = query.result
17
+ assert_equal 3, res["data"]["int"]
18
+ end
19
+
13
20
  it "can do nested lazy values" do
14
21
  res = run_query %|
15
22
  {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.16
4
+ version: 1.8.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo