graphql-client 0.10.0 → 0.11.0

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: 54d0c609ffe31a1375380c8647fe4a1502f19a76
4
- data.tar.gz: 57dc7311a2da955fa6a7297aa383eacf7473bee6
3
+ metadata.gz: 67a5d3c0e1e3fdcbee847a027e1106b72e83b150
4
+ data.tar.gz: e3f39bab58833143d12972c7c33ef1ca9abaab09
5
5
  SHA512:
6
- metadata.gz: 645186f0b676ade5ec368fe51c0a0fc97110fb6d100eb08411b8f079b8e793c5837c94bde44d44a4ec119fe40593ddce826c943a3ee660635e4c8899dbcdfdcd
7
- data.tar.gz: ad0e699625c3f34dfec487284e94ca6a4e4dc31b2522f4a7909a162f9d7db6d27d42873b6a057e3b95158027a93f9eb3708dd3f12535a2d51f0da3fa1604a31c
6
+ metadata.gz: 2740e88f4255b25cac40222edd46c9b0d41f72a3ead64f33417e6dbedb8332f89aa26ba8d73262d3e9333a60f58ba4523ead6bb908020b2224c1cf5cd040580f
7
+ data.tar.gz: 5cb91a42b7191658c26c2586bd2b07033654de60f1004a17f3364d0051d9726fc5589e3409a0519ecc9f92eb75db464c0632a0839882e9d48bb9d733cf2f4715
@@ -41,9 +41,6 @@ module GraphQL
41
41
  # GraphQL::Client::Schema::PossibleTypes.
42
42
  attr_reader :schema_class
43
43
 
44
- # Deprecated: Use schema_class
45
- alias_method :type, :schema_class
46
-
47
44
  # Internal: Get underlying IRep Node for the definition.
48
45
  #
49
46
  # Returns GraphQL::InternalRepresentation::Node object.
@@ -24,11 +24,6 @@ module GraphQL
24
24
  # ActionView::Template::Handlers::ERB.erb_implementation = GraphQL::Client::Erubis
25
25
  #
26
26
  class Erubis < ActionView::Template::Handlers::Erubis
27
- # Deprecated: Use ViewModule.extract_graphql_section.
28
- def self.extract_graphql_section(src)
29
- ViewModule.extract_graphql_section(src)
30
- end
31
-
32
27
  include ErubisEnhancer
33
28
  end
34
29
  end
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "graphql/client/definition"
4
- require "graphql/client/deprecation"
5
4
 
6
5
  module GraphQL
7
6
  class Client
@@ -9,7 +8,7 @@ module GraphQL
9
8
  class FragmentDefinition < Definition
10
9
  def new(obj, *args)
11
10
  if obj.is_a?(Hash)
12
- GraphQL::Client::Deprecation.warn("constructing fragment wrapper from Hash is deprecated")
11
+ raise TypeError, "constructing fragment wrapper from Hash is deprecated"
13
12
  end
14
13
 
15
14
  super
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "active_support/inflector"
4
- require "graphql/client/deprecation"
5
4
  require "graphql/client/error"
6
5
  require "graphql/client/errors"
7
6
  require "graphql/client/schema/base_type"
@@ -63,15 +62,6 @@ module GraphQL
63
62
  define_method("#{method_name}?") do
64
63
  @data[name] ? true : false
65
64
  end
66
-
67
- if name != method_name
68
- define_method(name) do
69
- @casted_data.fetch(name) do
70
- @casted_data[name] = type.cast(@data[name], @errors.filter_by_path(name))
71
- end
72
- end
73
- Deprecation.deprecate_methods(self, name => "Use ##{method_name} instead")
74
- end
75
65
  end
76
66
 
77
67
  def cast(value, errors)
@@ -110,6 +100,10 @@ module GraphQL
110
100
  rescue NoMethodError => e
111
101
  type = self.class.type
112
102
 
103
+ if ActiveSupport::Inflector.underscore(e.name.to_s) != e.name.to_s
104
+ raise e
105
+ end
106
+
113
107
  field = type.all_fields.find do |f|
114
108
  f.name == e.name.to_s || ActiveSupport::Inflector.underscore(f.name) == e.name.to_s
115
109
  end
@@ -145,17 +139,6 @@ module GraphQL
145
139
  buf << ">"
146
140
  buf
147
141
  end
148
-
149
- def typename
150
- Deprecation.deprecation_warning("typename", "Use #class.type.name instead")
151
- self.class.type.name
152
- end
153
-
154
- def type_of?(*types)
155
- Deprecation.deprecation_warning("type_of?", "Use #is_a? instead")
156
- names = ([self.class.type] + self.class.ancestors.select { |m| m.is_a?(InterfaceType) || m.is_a?(UnionType) }.map(&:type)).map(&:name)
157
- types.any? { |type| names.include?(type.to_s) }
158
- end
159
142
  end
160
143
  end
161
144
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-15 00:00:00.000000000 Z
11
+ date: 2017-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -160,7 +160,6 @@ files:
160
160
  - lib/graphql/client/collocated_enforcement.rb
161
161
  - lib/graphql/client/definition.rb
162
162
  - lib/graphql/client/definition_variables.rb
163
- - lib/graphql/client/deprecation.rb
164
163
  - lib/graphql/client/document_types.rb
165
164
  - lib/graphql/client/error.rb
166
165
  - lib/graphql/client/errors.rb
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
- require "active_support/deprecation"
3
-
4
- module GraphQL
5
- class Client
6
- if ActiveSupport::Deprecation.is_a?(Class)
7
- Deprecation = ActiveSupport::Deprecation.new("11.0", "graphql-client")
8
- else
9
- module Deprecation
10
- extend self
11
-
12
- def silence(&block)
13
- ActiveSupport::Deprecation.silence(&block)
14
- end
15
-
16
- def warn(*args)
17
- ActiveSupport::Deprecation.warn(*args)
18
- end
19
-
20
- def deprecate_methods(*args)
21
- # TODO
22
- end
23
-
24
- def deprecation_warning(deprecated_method_name, message = nil, caller_backtrace = nil)
25
- warn "#{deprecated_method_name} is deprecated and will be removed from graphql-client 0.11 (#{message})"
26
- end
27
- end
28
- end
29
- end
30
- end