graphql 2.3.3 → 2.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/graphql/install/mutation_root_generator.rb +2 -2
  3. data/lib/graphql/analysis/ast/query_complexity.rb +1 -1
  4. data/lib/graphql/dataloader/async_dataloader.rb +1 -0
  5. data/lib/graphql/dataloader/null_dataloader.rb +1 -1
  6. data/lib/graphql/dataloader.rb +6 -3
  7. data/lib/graphql/execution/interpreter/runtime/graphql_result.rb +7 -4
  8. data/lib/graphql/execution/interpreter/runtime.rb +52 -63
  9. data/lib/graphql/execution/interpreter.rb +1 -1
  10. data/lib/graphql/language/nodes.rb +60 -26
  11. data/lib/graphql/language/parser.rb +56 -15
  12. data/lib/graphql/query.rb +2 -2
  13. data/lib/graphql/rubocop/graphql/base_cop.rb +1 -1
  14. data/lib/graphql/schema/addition.rb +21 -11
  15. data/lib/graphql/schema/has_single_input_argument.rb +1 -0
  16. data/lib/graphql/schema/input_object.rb +1 -0
  17. data/lib/graphql/schema/introspection_system.rb +2 -2
  18. data/lib/graphql/schema/late_bound_type.rb +4 -0
  19. data/lib/graphql/schema/list.rb +2 -2
  20. data/lib/graphql/schema/member/has_arguments.rb +2 -35
  21. data/lib/graphql/schema/member/has_directives.rb +1 -1
  22. data/lib/graphql/schema/member/relay_shortcuts.rb +1 -1
  23. data/lib/graphql/schema/member/type_system_helpers.rb +1 -2
  24. data/lib/graphql/schema/warden.rb +2 -3
  25. data/lib/graphql/schema.rb +20 -20
  26. data/lib/graphql/static_validation/rules/fields_will_merge.rb +1 -1
  27. data/lib/graphql/subscriptions/action_cable_subscriptions.rb +1 -1
  28. data/lib/graphql/tracing/prometheus_trace.rb +8 -8
  29. data/lib/graphql/tracing/sentry_trace.rb +10 -10
  30. data/lib/graphql/type_kinds.rb +1 -1
  31. data/lib/graphql/version.rb +1 -1
  32. data/lib/graphql.rb +0 -8
  33. metadata +2 -2
@@ -12,7 +12,7 @@ module GraphQL
12
12
  @set_transaction_name = set_transaction_name
13
13
  super
14
14
  end
15
-
15
+
16
16
  def execute_query(**data)
17
17
  set_this_txn_name = data[:query].context[:set_sentry_transaction_name]
18
18
  if set_this_txn_name == true || (set_this_txn_name.nil? && @set_transaction_name)
@@ -20,7 +20,7 @@ module GraphQL
20
20
  scope.set_transaction_name(transaction_name(data[:query]))
21
21
  end
22
22
  end
23
- instrument_execution("graphql.execute", "execute_query", data) { super }
23
+ instrument_sentry_execution("graphql.execute", "execute_query", data) { super }
24
24
  end
25
25
 
26
26
  {
@@ -34,33 +34,33 @@ module GraphQL
34
34
  }.each do |trace_method, platform_key|
35
35
  module_eval <<-RUBY, __FILE__, __LINE__
36
36
  def #{trace_method}(**data)
37
- instrument_execution("#{platform_key}", "#{trace_method}", data) { super }
37
+ instrument_sentry_execution("#{platform_key}", "#{trace_method}", data) { super }
38
38
  end
39
39
  RUBY
40
40
  end
41
41
 
42
42
  def platform_execute_field(platform_key, &block)
43
- instrument_execution(platform_key, "execute_field", &block)
43
+ instrument_sentry_execution(platform_key, "execute_field", &block)
44
44
  end
45
45
 
46
46
  def platform_execute_field_lazy(platform_key, &block)
47
- instrument_execution(platform_key, "execute_field_lazy", &block)
47
+ instrument_sentry_execution(platform_key, "execute_field_lazy", &block)
48
48
  end
49
49
 
50
50
  def platform_authorized(platform_key, &block)
51
- instrument_execution(platform_key, "authorized", &block)
51
+ instrument_sentry_execution(platform_key, "authorized", &block)
52
52
  end
53
53
 
54
54
  def platform_authorized_lazy(platform_key, &block)
55
- instrument_execution(platform_key, "authorized_lazy", &block)
55
+ instrument_sentry_execution(platform_key, "authorized_lazy", &block)
56
56
  end
57
57
 
58
58
  def platform_resolve_type(platform_key, &block)
59
- instrument_execution(platform_key, "resolve_type", &block)
59
+ instrument_sentry_execution(platform_key, "resolve_type", &block)
60
60
  end
61
61
 
62
62
  def platform_resolve_type_lazy(platform_key, &block)
63
- instrument_execution(platform_key, "resolve_type_lazy", &block)
63
+ instrument_sentry_execution(platform_key, "resolve_type_lazy", &block)
64
64
  end
65
65
 
66
66
  def platform_field_key(field)
@@ -77,7 +77,7 @@ module GraphQL
77
77
 
78
78
  private
79
79
 
80
- def instrument_execution(platform_key, trace_method, data=nil, &block)
80
+ def instrument_sentry_execution(platform_key, trace_method, data=nil, &block)
81
81
  return yield unless Sentry.initialized?
82
82
 
83
83
  Sentry.with_child_span(op: platform_key, start_timestamp: Sentry.utc_now.to_f) do |span|
@@ -16,7 +16,7 @@ module GraphQL
16
16
  @description = description
17
17
  end
18
18
 
19
- # Does this TypeKind have multiple possible implementors?
19
+ # Does this TypeKind have multiple possible implementers?
20
20
  # @deprecated Use `abstract?` instead of `resolves?`.
21
21
  def resolves?; @abstract; end
22
22
  # Is this TypeKind abstract?
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "2.3.3"
3
+ VERSION = "2.3.5"
4
4
  end
data/lib/graphql.rb CHANGED
@@ -6,14 +6,6 @@ require "singleton"
6
6
  require "forwardable"
7
7
 
8
8
  module GraphQL
9
- # forwards-compat for argument handling
10
- module Ruby2Keywords
11
- if RUBY_VERSION < "2.7"
12
- def ruby2_keywords(*)
13
- end
14
- end
15
- end
16
-
17
9
  class Error < StandardError
18
10
  end
19
11
 
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.3.3
4
+ version: 2.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-09 00:00:00.000000000 Z
11
+ date: 2024-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64