graphql 1.5.6 → 1.5.7

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: 8fd00bd7b6d3c884c97818e792423683197e2f45
4
- data.tar.gz: 731475b235eb76d4ea0e574e734d8adba1188c96
3
+ metadata.gz: 4d1445225e17cd94b149bf884103195d179505a0
4
+ data.tar.gz: 909292e9525c37d417b6a97106b0dbe49a899ca6
5
5
  SHA512:
6
- metadata.gz: 54fc7fd2ac112ba5be3d405d256dfe81d3dfa58c688820f406fbe97671245b7395076484915b1c67cb074a948304c015af52f5888fa1670eee88bc68f7dab779
7
- data.tar.gz: d4fc22d899a6ea6fd5bbd3895c0f5c5837956a3264b0badbfc6f09237a07ac02fa489b3f114f62c3247067157a4e85051f48cee4d301be89d5792d48893d2af2
6
+ metadata.gz: 7730356cc09f2b67a53096830fdb0faef1e8a3b122075a8775ec339375463a9e863dfb48b5fca7efffd9f81f598b486390a8439c1014edafdb1640956f82245c
7
+ data.tar.gz: c21a3b0f34745786c26c626403ffbfbfe528a61d19f12458d81ea3620932868efdcde017c61df16f6ac074401d48c19aea5a0bb578e6fd9b4e7d31b462f51f36
@@ -25,6 +25,7 @@ module GraphQL
25
25
  type: function.type,
26
26
  resolve: function,
27
27
  description: function.description,
28
+ function: function,
28
29
  deprecation_reason: function.deprecation_reason,
29
30
  )
30
31
  elsif field.is_a?(GraphQL::Field)
@@ -89,11 +89,14 @@ module GraphQL
89
89
  end
90
90
 
91
91
  def definition_name
92
- @definition_name ||= definition.name
92
+ definition && definition.name
93
93
  end
94
94
 
95
95
  def definition
96
- @definition ||= @query.get_field(@owner_type, @definitions.first.name)
96
+ @definition ||= begin
97
+ first_def = @definitions.first
98
+ first_def && @query.get_field(@owner_type, first_def.name)
99
+ end
97
100
  end
98
101
 
99
102
  def ast_node
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "1.5.6"
3
+ VERSION = "1.5.7"
4
4
  end
@@ -105,6 +105,7 @@ describe GraphQL::InternalRepresentation::Rewrite do
105
105
 
106
106
  it "groups selections by object types which they apply to" do
107
107
  doc = rewrite_result["getPlant"]
108
+ assert_equal nil, doc.definition
108
109
 
109
110
  plant_scoped_selection = doc.scoped_children[schema.types["Query"]]["plant"]
110
111
  assert_equal ["Fruit", "Nut", "Plant", "Tree"], plant_scoped_selection.scoped_children.keys.map(&:name).sort
@@ -11,6 +11,11 @@ describe GraphQL::Relay::ConnectionField do
11
11
  assert_equal ["tests"], test_type.fields.keys
12
12
  end
13
13
 
14
+ it "keeps a reference to the function" do
15
+ conn_field = StarWars::Faction.fields["shipsWithMaxPageSize"]
16
+ assert_instance_of StarWars::ShipsWithMaxPageSize, conn_field.function
17
+ end
18
+
14
19
  it "leaves the original field untouched" do
15
20
  test_type = nil
16
21
 
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.6
4
+ version: 1.5.7
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-10 00:00:00.000000000 Z
11
+ date: 2017-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips