graphql 1.5.7 → 1.5.7.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d1445225e17cd94b149bf884103195d179505a0
4
- data.tar.gz: 909292e9525c37d417b6a97106b0dbe49a899ca6
3
+ metadata.gz: 1d62327a63cfe014162e4914f6667336e606e8ff
4
+ data.tar.gz: 2605ce8d9b8c31b29ad2c539f4da250e02450f66
5
5
  SHA512:
6
- metadata.gz: 7730356cc09f2b67a53096830fdb0faef1e8a3b122075a8775ec339375463a9e863dfb48b5fca7efffd9f81f598b486390a8439c1014edafdb1640956f82245c
7
- data.tar.gz: c21a3b0f34745786c26c626403ffbfbfe528a61d19f12458d81ea3620932868efdcde017c61df16f6ac074401d48c19aea5a0bb578e6fd9b4e7d31b462f51f36
6
+ metadata.gz: dc114df5775f181f92b11aff4c4eaf022506b994d69889fd88643fa7f0b03348ffaddfe7e2851032a6a384259629d5484dfbabb9b7e7185875336390066037f4
7
+ data.tar.gz: 490d0958520560087668555b95e91d4188a068a32ab87f9d02d21924da843b9108da9cac3d558b36314705344737a4271a537ce66535f441030a240a6e02747a
@@ -113,8 +113,8 @@ module GraphQL
113
113
  # Selections are merged in place, not copied.
114
114
  def deep_merge_node(new_parent, merge_self: true)
115
115
  if merge_self
116
- @ast_nodes.concat(new_parent.ast_nodes)
117
- @definitions.concat(new_parent.definitions)
116
+ @ast_nodes |= new_parent.ast_nodes
117
+ @definitions |= new_parent.definitions
118
118
  end
119
119
  new_parent.scoped_children.each do |obj_type, new_fields|
120
120
  prev_fields = @scoped_children[obj_type]
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "1.5.7"
3
+ VERSION = "1.5.7.1"
4
4
  end
@@ -6,6 +6,7 @@ describe GraphQL::InternalRepresentation::Rewrite do
6
6
  GraphQL::Schema.from_definition <<-GRAPHQL
7
7
  type Query {
8
8
  plant(id: ID!): Plant
9
+ fruit(id: ID!): [Fruit!]
9
10
  }
10
11
 
11
12
  union Plant = Grain | Fruit | Vegetable | Nut
@@ -44,7 +45,11 @@ describe GraphQL::InternalRepresentation::Rewrite do
44
45
  habitats: [Habitat]
45
46
  }
46
47
 
47
- type Habitat {
48
+ interface Environ {
49
+ seasons: [String]
50
+ }
51
+
52
+ type Habitat implements Environ {
48
53
  residentName: String!
49
54
  averageWeight: Int!
50
55
  seasons: [String]
@@ -286,4 +291,36 @@ describe GraphQL::InternalRepresentation::Rewrite do
286
291
  end
287
292
  end
288
293
  end
294
+
295
+ describe "fragment merging bug" do
296
+ let(:query_string) {
297
+ <<-GRAPHQL
298
+ {
299
+ ...Frag1
300
+ __type(name: "Query") {
301
+ ...Frag2
302
+ }
303
+ }
304
+
305
+ fragment Frag1 on Query {
306
+ __type(name: "Query") {
307
+ ...Frag2
308
+ }
309
+ }
310
+
311
+ fragment Frag2 on __Type {
312
+ __typename
313
+ }
314
+ GRAPHQL
315
+ }
316
+
317
+ it "finishes" do
318
+ doc = rewrite_result[nil]
319
+ type_node = doc.typed_children[schema.types["Query"]]["__type"]
320
+ typename_node = type_node.typed_children[schema.types["__Type"]]["__typename"]
321
+ assert_equal 1, typename_node.ast_nodes.size
322
+ assert_equal 15, typename_node.ast_node.line
323
+ assert_equal 9, typename_node.ast_node.col
324
+ end
325
+ end
289
326
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.7
4
+ version: 1.5.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-14 00:00:00.000000000 Z
11
+ date: 2017-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips