graphql 2.0.1 → 2.0.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
  SHA256:
3
- metadata.gz: f37881627f4e4ddcdb6f2f83f395982d624396949b7e26c1c7fa395f34b6c37a
4
- data.tar.gz: c4840087ffff471824df26453876279b2e44014cdf99f9778b35481c917e18fa
3
+ metadata.gz: 445a61081bd654dbd59e1d6472e027958f8f88bcb5b3f32351921c5f24f7c572
4
+ data.tar.gz: d33ff0a628621fe4ccb4e19fbf727ce1e2cffe950697b33bc3682420bb6d2a81
5
5
  SHA512:
6
- metadata.gz: 34999652dad1730d8cf51a46b213dc62d34a00e429b734da857aadbe5d5497c1a70c5d6ebc9d0a316db65a2e8e40075ab56d8bb59eb1cdc45b88c9549149ff92
7
- data.tar.gz: 8ff253848a6fcdaaaa831c87377b4b9d4ca494704bba0844336dc3c500b125df5f888f076f77cdf4fae61c03b2d8cb9383e18406bbf8b6ab2d7bd399dd54bf7d
6
+ metadata.gz: 5d2f6f4c7556db47fec205db4007958f397e8a6b25c40a1838cf0789bf5e71162b0fe62305cb703ec5d5e61371513e978e9544a2f8622787c488d1fbad547af2
7
+ data.tar.gz: c477b6a6c782e0bd5ef1eec47fc5dc6fa4ff56d21352c4ee1f6783debd8506c52cf6eace82c639166033b02436d4eebf5a18116624ad7ffd62d19ed8c5735dc0
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
- require_relative "./query_complexity"
3
2
  module GraphQL
4
3
  module Analysis
5
4
  module AST
@@ -75,7 +75,10 @@ module GraphQL
75
75
  end
76
76
  end
77
77
 
78
- self.validates(validates)
78
+ if validates && !validates.empty?
79
+ self.validates(validates)
80
+ end
81
+
79
82
  if required == :nullable
80
83
  self.owner.validates(required: { argument: arg_name })
81
84
  end
@@ -303,7 +303,9 @@ module GraphQL
303
303
  end
304
304
  end
305
305
 
306
- self.validates(validates)
306
+ if !validates.empty?
307
+ self.validates(validates)
308
+ end
307
309
 
308
310
  if definition_block
309
311
  if definition_block.arity == 1
@@ -80,7 +80,7 @@ module GraphQL
80
80
  visible_interfaces.concat(superclass.interfaces(context))
81
81
  end
82
82
 
83
- visible_interfaces
83
+ visible_interfaces.uniq
84
84
  end
85
85
  end
86
86
  end
@@ -98,9 +98,14 @@ module GraphQL
98
98
  class << self
99
99
  # Set up a type-specific invalid null error to use when this object's non-null fields wrongly return `nil`.
100
100
  # It should help with debugging and bug tracker integrations.
101
- def inherited(child_class)
102
- child_class.const_set(:InvalidNullError, GraphQL::InvalidNullError.subclass_for(child_class))
103
- super
101
+ def const_missing(name)
102
+ if name == :InvalidNullError
103
+ custom_err_class = GraphQL::InvalidNullError.subclass_for(self)
104
+ const_set(:InvalidNullError, custom_err_class)
105
+ custom_err_class
106
+ else
107
+ super
108
+ end
104
109
  end
105
110
 
106
111
  def kind
@@ -20,7 +20,17 @@ module GraphQL
20
20
  @payload_type ||= generate_payload_type
21
21
  end
22
22
 
23
- # alias :type :payload_type
23
+ def type(new_type = nil, null: nil)
24
+ if new_type
25
+ payload_type(new_type)
26
+ if !null.nil?
27
+ self.null(null)
28
+ end
29
+ else
30
+ super()
31
+ end
32
+ end
33
+
24
34
  alias :type_expr :payload_type
25
35
 
26
36
  def field_class(new_class = nil)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "2.0.1"
3
+ VERSION = "2.0.2"
4
4
  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: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-21 00:00:00.000000000 Z
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips