graphql 1.13.9 → 1.13.12

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: 6d96eacd39201c81802bc7a525b5ff5392e918582ef7814a14c5f650d82fa1ca
4
- data.tar.gz: 45f26d9425c711c1d91026837f900fa172a511258a95ae1ba9356c76fcf905bb
3
+ metadata.gz: 90fcd1d4c840be80d47ed66bad6c4cdd4c16a4981b249b57e7e126a3ff5d5d6d
4
+ data.tar.gz: 6d9f87843cd626dff3a9f46158fce7f1be22c3f1aa4131c8b2390b82f93edb52
5
5
  SHA512:
6
- metadata.gz: bc31be3568df7a167eda2ae0c81ae05999cc34de47a5a0aeae082795b7ae4750d4b1b17c744e5f6100cf4b9039e51371f0fb82c37cd1ceb72febf1bb2ef898fd
7
- data.tar.gz: 723da375b4060fc8d348a7b84261fe2c3ed6f06c32ad346feaeef7ec1dee11a91666f91a2d38c0f750c0a2373114f9a4f7a9d4f0775e28bac72b3e5c954a2dc4
6
+ metadata.gz: 355972194b55f12d4bc43d610249c94ce6d73c574f12688863b01bf60ad4f2a9ad093ee19c76403f4b84371583ea5c236a3d7cfda72e3564a222dd9f12c1d0ea
7
+ data.tar.gz: 5ebd795ac0884a46f413e4ede96165d3b2be2489266c36fbc06d90f0d940e69a2afa86c86417757716dc47ddc9c3bdbbe475c7f1547951c5cbe843a0ed7d45e5
@@ -3,7 +3,7 @@ module GraphQL
3
3
  # @api deprecated
4
4
  class Argument
5
5
  include GraphQL::Define::InstanceDefinable
6
- accepts_definitions :name, :type, :description, :default_value, :as, :prepare, :method_access, :deprecation_reason
6
+ deprecated_accepts_definitions :name, :type, :description, :default_value, :as, :prepare, :method_access, :deprecation_reason
7
7
  attr_reader :default_value
8
8
  attr_accessor :description, :name, :as, :deprecation_reason
9
9
  attr_accessor :ast_node
@@ -8,7 +8,7 @@ module GraphQL
8
8
  include GraphQL::Define::InstanceDefinable
9
9
  include GraphQL::Relay::TypeExtensions
10
10
 
11
- accepts_definitions :name, :description,
11
+ deprecated_accepts_definitions :name, :description,
12
12
  :introspection,
13
13
  :default_scalar,
14
14
  :default_relay,
@@ -167,6 +167,21 @@ ERR
167
167
  # Each symbol in `accepts` will be assigned with `{key}=`.
168
168
  # The last entry in accepts may be a hash of name-proc pairs for custom definitions.
169
169
  def accepts_definitions(*accepts)
170
+ deprecated_caller = caller(0, 1).first
171
+ if deprecated_caller.include?("lib/graphql")
172
+ deprecated_caller = caller(2, 10).find { |c| !c.include?("lib/graphql") }
173
+ end
174
+
175
+ if deprecated_caller
176
+ GraphQL::Deprecation.warn <<-ERR
177
+ #{self}.accepts_definitions will be removed in GraphQL-Ruby 2.0; use a class-based definition instead. See https://graphql-ruby.org/schema/class_based_api.html.
178
+ -> called from #{deprecated_caller}
179
+ ERR
180
+ end
181
+ deprecated_accepts_definitions(*accepts)
182
+ end
183
+
184
+ def deprecated_accepts_definitions(*accepts)
170
185
  new_assignments = if accepts.last.is_a?(Hash)
171
186
  accepts.pop.dup
172
187
  else
@@ -8,7 +8,7 @@ module GraphQL
8
8
  #
9
9
  class Directive
10
10
  include GraphQL::Define::InstanceDefinable
11
- accepts_definitions :locations, :name, :description, :arguments, :default_directive, argument: GraphQL::Define::AssignArgument
11
+ deprecated_accepts_definitions :locations, :name, :description, :arguments, :default_directive, argument: GraphQL::Define::AssignArgument
12
12
 
13
13
  attr_accessor :locations, :arguments, :name, :description, :arguments_class
14
14
  attr_accessor :ast_node
@@ -4,7 +4,7 @@ module GraphQL
4
4
  class EnumType < GraphQL::BaseType
5
5
  extend Define::InstanceDefinable::DeprecatedDefine
6
6
 
7
- accepts_definitions :values, value: GraphQL::Define::AssignEnumValue
7
+ deprecated_accepts_definitions :values, value: GraphQL::Define::AssignEnumValue
8
8
  ensure_defined(:values, :validate_non_null_input, :coerce_non_null_input, :coerce_result)
9
9
  attr_accessor :ast_node
10
10
 
@@ -72,7 +72,7 @@ module GraphQL
72
72
  class EnumValue
73
73
  include GraphQL::Define::InstanceDefinable
74
74
  ATTRIBUTES = [:name, :description, :deprecation_reason, :value]
75
- accepts_definitions(*ATTRIBUTES)
75
+ deprecated_accepts_definitions(*ATTRIBUTES)
76
76
  attr_accessor(*ATTRIBUTES)
77
77
  attr_accessor :ast_node
78
78
  ensure_defined(*ATTRIBUTES)
data/lib/graphql/field.rb CHANGED
@@ -5,7 +5,7 @@ module GraphQL
5
5
  # @api deprecated
6
6
  class Field
7
7
  include GraphQL::Define::InstanceDefinable
8
- accepts_definitions :name, :description, :deprecation_reason,
8
+ deprecated_accepts_definitions :name, :description, :deprecation_reason,
9
9
  :resolve, :lazy_resolve,
10
10
  :type, :arguments,
11
11
  :property, :hash_key, :complexity,
@@ -4,7 +4,7 @@ module GraphQL
4
4
  class InputObjectType < GraphQL::BaseType
5
5
  extend Define::InstanceDefinable::DeprecatedDefine
6
6
 
7
- accepts_definitions(
7
+ deprecated_accepts_definitions(
8
8
  :arguments, :mutation,
9
9
  input_field: GraphQL::Define::AssignArgument,
10
10
  argument: GraphQL::Define::AssignArgument
@@ -4,7 +4,7 @@ module GraphQL
4
4
  class InterfaceType < GraphQL::BaseType
5
5
  extend Define::InstanceDefinable::DeprecatedDefine
6
6
 
7
- accepts_definitions :fields, :orphan_types, :resolve_type, field: GraphQL::Define::AssignObjectField
7
+ deprecated_accepts_definitions :fields, :orphan_types, :resolve_type, field: GraphQL::Define::AssignObjectField
8
8
 
9
9
  attr_accessor :fields, :orphan_types, :resolve_type_proc
10
10
  attr_writer :type_membership_class
@@ -4,8 +4,8 @@ module GraphQL
4
4
  class ObjectType < GraphQL::BaseType
5
5
  extend Define::InstanceDefinable::DeprecatedDefine
6
6
 
7
- accepts_definitions :interfaces, :fields, :mutation, :relay_node_type, field: GraphQL::Define::AssignObjectField
8
- accepts_definitions implements: ->(type, *interfaces, inherit: false) { type.implements(interfaces, inherit: inherit) }
7
+ deprecated_accepts_definitions :interfaces, :fields, :mutation, :relay_node_type, field: GraphQL::Define::AssignObjectField
8
+ deprecated_accepts_definitions implements: ->(type, *interfaces, inherit: false) { type.implements(interfaces, inherit: inherit) }
9
9
 
10
10
  attr_accessor :fields, :mutation, :relay_node_type
11
11
  ensure_defined(:fields, :mutation, :interfaces, :relay_node_type)
@@ -5,9 +5,22 @@ module GraphQL
5
5
  module ConnectionType
6
6
  class << self
7
7
  # @return [Boolean] If true, connection types get a `nodes` shortcut field
8
- attr_accessor :default_nodes_field
8
+ def default_nodes_field=(new_setting)
9
+ if new_setting
10
+ warn("GraphQL::Relay::ConnectionType will be removed in GraphQL 2.0.0; migrate to `GraphQL::Pagination::Connections` and remove this setting (`default_nodes_field = true`).")
11
+ end
12
+ @default_nodes_field = new_setting
13
+ end
14
+ attr_reader :default_nodes_field
15
+
9
16
  # @return [Boolean] If true, connections check for reverse-direction `has*Page` values
10
- attr_accessor :bidirectional_pagination
17
+ def bidirectional_pagination=(new_setting)
18
+ if new_setting
19
+ warn("GraphQL::Relay::ConnectionType will be removed in GraphQL 2.0.0; migrate to `GraphQL::Pagination::Connections` and remove this setting (`bidirectional_pagination = true`).")
20
+ end
21
+ @bidirectional_pagination = new_setting
22
+ end
23
+ attr_reader :bidirectional_pagination
11
24
  end
12
25
 
13
26
  self.default_nodes_field = false
@@ -10,8 +10,7 @@ module GraphQL
10
10
  if obj.is_a?(GraphQL::Schema::Object)
11
11
  obj = obj.object
12
12
  end
13
- type = @type.respond_to?(:graphql_definition) ? @type.graphql_definition(silence_deprecation_warning: true) : @type
14
- ctx.query.schema.id_from_object(obj, type, ctx)
13
+ ctx.query.schema.id_from_object(obj, @type, ctx)
15
14
  end
16
15
  end
17
16
  end
@@ -8,7 +8,7 @@ module GraphQL
8
8
  # @api deprecated
9
9
  class Mutation
10
10
  include GraphQL::Define::InstanceDefinable
11
- accepts_definitions(
11
+ deprecated_accepts_definitions(
12
12
  :name, :description, :resolve,
13
13
  :return_type,
14
14
  :return_interfaces,
@@ -35,6 +35,10 @@ module GraphQL
35
35
  # @param context [GraphQL::Query::Context] The surrounding `ctx`, will be passed to the connection if provided (this is required for cursor encoders)
36
36
  # @param edge_class [Class] The class to wrap `item` with (defaults to the connection's edge class)
37
37
  def initialize(collection:, item:, parent: nil, context: nil, edge_class: nil)
38
+ if context.nil?
39
+ caller_loc = caller(2, 1).first
40
+ GraphQL::Deprecation.warn("`context: ...` will be required by `RangeAdd.new` in GraphQL-Ruby 2.0. Add `context: context` to the call at #{caller_loc}.")
41
+ end
38
42
  if context && context.schema.new_connections?
39
43
  conn_class = context.schema.connections.wrapper_for(collection)
40
44
  # The rest will be added by ConnectionExtension
@@ -4,7 +4,7 @@ module GraphQL
4
4
  class ScalarType < GraphQL::BaseType
5
5
  extend Define::InstanceDefinable::DeprecatedDefine
6
6
 
7
- accepts_definitions :coerce, :coerce_input, :coerce_result
7
+ deprecated_accepts_definitions :coerce, :coerce_input, :coerce_result
8
8
  ensure_defined :coerce_non_null_input, :coerce_result
9
9
 
10
10
  module NoOpCoerce
@@ -161,7 +161,7 @@ module GraphQL
161
161
  include LazyHandlingMethods
162
162
  extend LazyHandlingMethods
163
163
 
164
- accepts_definitions \
164
+ deprecated_accepts_definitions \
165
165
  :query_execution_strategy, :mutation_execution_strategy, :subscription_execution_strategy,
166
166
  :validate_timeout, :validate_max_errors, :max_depth, :max_complexity, :default_max_page_size,
167
167
  :orphan_types, :resolve_type, :type_error, :parse_error,
@@ -1730,6 +1730,7 @@ module GraphQL
1730
1730
  {
1731
1731
  backtrace: ctx[:backtrace],
1732
1732
  tracers: ctx[:tracers],
1733
+ dataloader: ctx[:dataloader],
1733
1734
  }
1734
1735
  else
1735
1736
  {}
@@ -11,7 +11,7 @@ module GraphQL
11
11
  end
12
12
  end
13
13
 
14
- accepts_definitions :resolve_type, :type_membership_class,
14
+ deprecated_accepts_definitions :resolve_type, :type_membership_class,
15
15
  possible_types: AcceptPossibleTypesDefinition
16
16
  ensure_defined :possible_types, :resolve_type, :resolve_type_proc, :type_membership_class
17
17
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "1.13.9"
3
+ VERSION = "1.13.12"
4
4
  end
data/lib/graphql.rb CHANGED
@@ -83,6 +83,7 @@ require "graphql/string_encoding_error"
83
83
  require "graphql/date_encoding_error"
84
84
 
85
85
  require "graphql/define"
86
+ require "graphql/deprecation"
86
87
  require "graphql/base_type"
87
88
  require "graphql/object_type"
88
89
  require "graphql/enum_type"
@@ -119,7 +120,6 @@ require "graphql/internal_representation"
119
120
  require "graphql/directive"
120
121
  require "graphql/static_validation"
121
122
  require "graphql/execution"
122
- require "graphql/deprecation"
123
123
  require "graphql/boolean_type"
124
124
  require "graphql/float_type"
125
125
  require "graphql/id_type"
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.13.9
4
+ version: 1.13.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-09 00:00:00.000000000 Z
11
+ date: 2022-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips
@@ -707,7 +707,7 @@ metadata:
707
707
  source_code_uri: https://github.com/rmosolgo/graphql-ruby
708
708
  bug_tracker_uri: https://github.com/rmosolgo/graphql-ruby/issues
709
709
  mailing_list_uri: https://tinyletter.com/graphql-ruby
710
- post_install_message:
710
+ post_install_message:
711
711
  rdoc_options: []
712
712
  require_paths:
713
713
  - lib
@@ -722,8 +722,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
722
722
  - !ruby/object:Gem::Version
723
723
  version: '0'
724
724
  requirements: []
725
- rubygems_version: 3.1.6
726
- signing_key:
725
+ rubygems_version: 3.2.32
726
+ signing_key:
727
727
  specification_version: 4
728
728
  summary: A GraphQL language and runtime for Ruby
729
729
  test_files: []